The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

What is wrong with < in script ?

View previous topic View next topic Go down

In progress What is wrong with < in script ?

Post by TamDonCo on August 30th 2016, 4:15 pm

the script file does not accept less than sign (<) whenever I change to < , script errors


ERROR



NO ERROR

avatar
TamDonCo
Forumember

Posts : 180
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

In progress Re: What is wrong with < in script ?

Post by Ange Tuteur on August 30th 2016, 4:41 pm

Hi @TamDonCo,

I didn't manage to replicate an error on my end. Then again I was doing it in the HTML pages, is that where you were getting the error ? Think

Try placing the content of your script in a CDATA section :
Code:
//<![CDATA[
// JAVASCRIPT HERE
//]]>

Here's my example script using CDATA :
Code:
<script type="text/javascript">//<![CDATA[
(function() {
  var a = 5,
      b = 6;
 
  if (a && b && window.console) {
 
    if (a < b) {
      console.log('Lesser');
    } else {
      console.log('Greater');
    }
 
  }
 
}());
//]]></script>

Here's a topic on CDATA :
http://stackoverflow.com/questions/7092236/what-is-cdata-in-html
avatar
Ange Tuteur
Forumaster

Male Posts : 13130
Reputation : 2816
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

In progress Re: What is wrong with < in script ?

Post by TamDonCo on August 30th 2016, 5:59 pm

Thanks Ange Tuteur

Let me try later
avatar
TamDonCo
Forumember

Posts : 180
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

In progress Re: What is wrong with < in script ?

Post by TamDonCo on August 30th 2016, 10:24 pm

hi Ange Tuteur

just update

it still has error

when I do

<script src=.......link here> < / script>

it works fine but I copy the contents and paste into file to run local and it has error

avatar
TamDonCo
Forumember

Posts : 180
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

In progress Re: What is wrong with < in script ?

Post by SLGray on August 31st 2016, 2:57 am

Where are you adding this code?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 38494
Reputation : 2589
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

In progress Re: What is wrong with < in script ?

Post by TamDonCo on August 31st 2016, 2:34 pm

@SLGray wrote:Where are you adding this code?

overall_footer_end
avatar
TamDonCo
Forumember

Posts : 180
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

In progress Re: What is wrong with < in script ?

Post by Ange Tuteur on August 31st 2016, 5:58 pm

@TamDonCo would it be possible for you to post the code here so that we may look over it ?
avatar
Ange Tuteur
Forumaster

Male Posts : 13130
Reputation : 2816
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

In progress Re: What is wrong with < in script ?

Post by TamDonCo on August 31st 2016, 6:09 pm

@Ange Tuteur wrote:@TamDonCo would it be possible for you to post the code here so that we may look over it ?

Yes I can but it 's very long script .. is it OK
avatar
TamDonCo
Forumember

Posts : 180
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

In progress Re: What is wrong with < in script ?

Post by TamDonCo on August 31st 2016, 6:56 pm

I can not post , it says "The posted message is too long."
avatar
TamDonCo
Forumember

Posts : 180
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

In progress Re: What is wrong with < in script ?

Post by SLGray on August 31st 2016, 8:59 pm

You can post it in 2 posts.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 38494
Reputation : 2589
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

In progress Re: What is wrong with < in script ?

Post by TamDonCo on September 1st 2016, 12:00 am

avatar
TamDonCo
Forumember

Posts : 180
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

In progress Re: What is wrong with < in script ?

Post by SLGray on September 1st 2016, 3:28 am

Could you post a screenshot of the error message you get?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 38494
Reputation : 2589
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

In progress Re: What is wrong with < in script ?

Post by TamDonCo on September 1st 2016, 3:57 am

This is no screen shot, this works backgroud, it lets user to type in Vietnamese because Vietname has accents such as , , ư , ủ ... etc.

the above link works well when you put in <script scr= ..... > < / script>
avatar
TamDonCo
Forumember

Posts : 180
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

In progress Re: What is wrong with < in script ?

Post by SLGray on September 1st 2016, 5:25 am

Maybe I do not understand the purpose of this for your forum. You can set your language in your profiles and forum for Vietnamese.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 38494
Reputation : 2589
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum