escaping < character

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pradeepjain
    Contributor
    • Jul 2007
    • 563

    escaping < character

    curimg=(curimg < (galleryarray.l ength-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
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Originally posted by pradeepjain
    curimg=(curimg < (galleryarray.l ength-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.

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by hsriat
      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?

      Comment

      • hsriat
        Recognized Expert Top Contributor
        • Jan 2008
        • 1653

        #4
        Originally posted by r035198x
        The brackets look fine to me.
        I feel it would be fine if used before the question mark instead in the end.

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          Originally posted by hsriat
          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.

          Comment

          • hsriat
            Recognized Expert Top Contributor
            • Jan 2008
            • 1653

            #6
            Originally posted by r035198x
            If that bracket at the end is removed, then the brackets don't balance.
            Ok, I mean to say it should be this
            Code:
            curimg=(curimg < (galleryarray.length-1)[U][B])[/B][/U]? curimg+1 : 0;

            Comment

            • pradeepjain
              Contributor
              • Jul 2007
              • 563

              #7
              i got the solution by escaping the javascript within

              <!--
              // -->


              Thanks,
              pradeep

              Comment

              • r035198x
                MVP
                • Sep 2006
                • 13225

                #8
                Originally posted by pradeepjain
                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?

                Comment

                • hsriat
                  Recognized Expert Top Contributor
                  • Jan 2008
                  • 1653

                  #9
                  Originally posted by pradeepjain
                  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.

                  Comment

                  Working...