By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,286 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,286 IT Pros & Developers. It's quick & easy.

escaping < character

pradeepjain
100+
P: 563
curimg=(curimg < (galleryarray.length-1)? curimg+1 : 0)

i am using this javascript but during validation it asks to escape the "<" ..i tried "&lt;" ...but if i use it the script stops working..any solution for this.



Thanks,
Pradeep
Jun 5 '08 #1
Share this Question
Share on Google+
8 Replies


hsriat
Expert 100+
P: 1,654
curimg=(curimg < (galleryarray.length-1)? curimg+1 : 0)

i am using this javascript but during validation it asks to escape the "<" ..i tried "&lt;" ...but if i use it the script stops working..any solution for this.



Thanks,
Pradeep
What kind of validation are you doing?..
Remove the last bracket.
Jun 5 '08 #2

10K+
P: 13,264
What kind of validation are you doing?..
Remove the last bracket.
The brackets look fine to me.
@OP Which code has been suggested as needing the escape character?
Jun 5 '08 #3

hsriat
Expert 100+
P: 1,654
The brackets look fine to me.
I feel it would be fine if used before the question mark instead in the end.
Jun 5 '08 #4

10K+
P: 13,264
I feel it would be fine if used before the question mark instead in the end.
If that bracket at the end is removed, then the brackets don't balance.
Jun 5 '08 #5

hsriat
Expert 100+
P: 1,654
If that bracket at the end is removed, then the brackets don't balance.
Ok, I mean to say it should be this
Expand|Select|Wrap|Line Numbers
  1. curimg=(curimg < (galleryarray.length-1))? curimg+1 : 0;
Jun 5 '08 #6

pradeepjain
100+
P: 563
i got the solution by escaping the javascript within

<!--
// -->


Thanks,
pradeep
Jun 6 '08 #7

10K+
P: 13,264
i got the solution by escaping the javascript within

<!--
// -->


Thanks,
pradeep
That's good news. As you can see it had nothing to do with the code you posted above. About that code you posted above, what did you want it to do?
Jun 6 '08 #8

hsriat
Expert 100+
P: 1,654
i got the solution by escaping the javascript within

<!--
// -->


Thanks,
pradeep
oh, so you were talking about w3c validator.

For that, if possible, keep your JS as external source.
Jun 6 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.