On Monday, 16 September 2013 at 16:11:15 UTC, Andrei Alexandrescu wrote:
BTW what's the deal with all those \xNN in the javascript?

newText += '  \x3Ca class="jumpto" href="\x23.' + a +
'"\x3E\x3Cspan class="notranslate donthyphenate"\x3E' + text + '\x3C/span\x3E\x3C/a\x3E';

I guess some care must be exercised so as to not confuse the HTML/Javascript parser, but only for things like </script> and probablt a couple more. No?

Not sure if this is the reason that applies to our case, but - you can use < and > in inline scripts in HTML, but not in XHTML, which must be well-formed XML. The exception is if the script code is wrapped in a CDATA block.

Reply via email to