Are CDATA tags ever necessary in script tags and if so when?
In other words, when and where is this:
It's an X(HT)ML thing. When you use symbols like <
and >
within the JavaScript, e.g. for comparing two integers, this would have to be parsed like XML, thus they would mark as a beginning or end of a tag.
The CDATA means that the following lines (everything up unto the ]]>
is not XML and thus should not be parsed that way.