cs.punk Posted April 4, 2010 Share Posted April 4, 2010 Just as the title states... Reading a ebook and is says I should be escaping it like so: "<p>test<\/p>"; Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 4, 2010 Share Posted April 4, 2010 Unless they state some special reason for it, you shouldn't. Quote Link to comment Share on other sites More sharing options...
cs.punk Posted April 4, 2010 Author Share Posted April 4, 2010 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 Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 4, 2010 Share Posted April 4, 2010 I didn't notice it's in JavaScript section not in PHP. I have little experience with JS, so I can't really say how true this is. Sorry for confusing you. Quote Link to comment Share on other sites More sharing options...
cs.punk Posted April 8, 2010 Author Share Posted April 8, 2010 Anyone?.. Ok I'll make it simpler. DO you escape / when your write JS? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.