When is a CDATA section necessary within a script tag?

Are CDATA tags ever necessary in script tags and if so when? In other words, when and where is this: <script type=”text/javascript”> //<![CDATA[ …code… //]]> </script> preferable to this: <script type=”text/javascript”> …code… </script> 15 s 15 A CDATA section is required if you need your document to parse as XML (e.g. when an XHTML page … Read more

What does in XML mean?

I often find this strange CDATA tag in XML files: <![CDATA[some stuff]]> I have observed that this CDATA tag always comes at the beginning, and then followed by some stuff. But sometimes it is used, sometimes it is not. I assume it is to mark that some stuff is the “data” that will be inserted … Read more