Jump to content

Quick Questin: Should I escape / as \/ when outputting to xhtml?


cs.punk

Recommended Posts

Unless they state some special reason for it, you shouldn't.

 

Even with the CDATA element in place, validators get confused by forward

slashes (like the one in the </em> tag). Whenever you want to use a / character

in JavaScript strings, precede it with a backslash (<\/em>). Doing so helps

the validator understand that you intend to place a slash character at the next

position.

 

er

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.