Skip to main content
Participant
March 26, 2021
Question

special characters must be escaped

  • March 26, 2021
  • 2 replies
  • 342 views

I cannot get my head around what seems to be a simple problem. Dreamweaver keeps getting an error code for "special characters must be escaped" for these two lines of code:

 

/* If the ball is about to go off screen horizontally, reverse
* the direction of the ball */
if ( x < 0 || x > 290)
dx = -dx;
/* If the ball is about to go off screen vertically, reverse
* the direction of the ball */
if ( y < 0 || y > 305)
dy =- dy;

 

It keeps marking the error where the comparisson operators "<" and the ">"  are used. Any ideas?

    This topic has been closed for replies.

    2 replies

    Jon Fritz
    Community Expert
    Community Expert
    March 26, 2021

    I don't get any validation errors with the code you've posted, when placed within <script> tags in the <head> of a new .html page.

     

    Could you copy and paste the entire code of the page here in the forum?

    That particular error usually doesn't have much to do with the line it appears on. Normally, there will be a problem earlier in your code that's confusing the linting tool, and DW finally gives up at the line that gets highlighted.

     

    BenPleysier
    Community Expert
    Community Expert
    March 26, 2021
    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
    Participant
    March 26, 2021

    Thank you Ben for your quick reply! 

    I had already read all other posts regarding this similar issue. From what I have read, most folks have issues with unclosed statements, php, and others. Mine simply does not allow me to use the two comparison operators, without flagging the line for an error and allowing me to continue.

     

    I went to the W3Schools site and it provides some clues about using “escape characters” using strings in JavaScript, but… as these two comparison operators “< >” are not used with strings inside “quotation marks” rather by using just numbers, and it is the reason why I cannot tell what Dreamweaver is suggesting to fix.

     

    PS. The file is an HTML document.