Path: csiph.com!aioe.org!news.mb-net.net!open-news-network.org!.POSTED.112.228.197.178.dynamic.wless.zhbmb00p-cgnat.res.cust.swisscom.ch!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: The less sign "<" in script elements Date: Mon, 19 Mar 2018 00:41:45 +0100 Organization: PointedEars Software (PES) Lines: 70 Message-ID: <2015900.iZASKD2KPV@PointedEars.de> References: Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit Injection-Info: gwaiyur.mb-net.net; posting-host="112.228.197.178.dynamic.wless.zhbmb00p-cgnat.res.cust.swisscom.ch:178.197.228.112"; logging-data="7624"; mail-complaints-to="abuse@open-news-network.org" User-Agent: KNode/4.14.2 X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. So, is my memory correct that in HTML 2, HTML 3 and/or > HTML 4, one had to escape a less sign in a script element, > using, e.g., »<«? E.g., for a comparison like »x (a common example of this was code generated by Macromedia Dreamweaver) But that merely masks the markup errors which is a problem when serving XHTML with the proper Content-Type “application/xhtml+xml” (those people then resorted to serving XHTML with Content-Type “text/html”, which I think contributed to the demise of XHTML – most people simply did not bother to understand the powerful tool that they were given). The correct way in XHTML (as “application/xhtml+xml”) is, of course, as you indicated, because the CDATA section declaration makes clear where the CDATA begins and ends. However “]]>” must to be escaped instead, or an external script resource must be used.] I have written (this) *countless* times (about that) in several newsgroups/forums, including this one; so have other people [the first Google hit for “script etago” is an article by Mathias Bynens citing a test case by IIRC then-cljs regular Juriy ‘kangax’ Zaytsev (Юрий Зайцев)]. You can still verify it if you use the W3C Markup Validator at : 1. 2. More Options → (·) Validate HTML fragment → Use Doctype: HTML 4.01 3. Markup to validate (without indentation): 4. Check → 5. “Error: end tag for element "P" which is not open […] If this error occurred in a script section of your document, you should probably read this FAQ entry .” -- PointedEars FAQ: | | Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.