Why are some JavaScripts encapsulated within these tags:
<!--//--><![CDATA[//><!--
some js here
//--><!]]>
Why are some JavaScripts encapsulated within these tags:
<!--//--><![CDATA[//><!--
some js here
//--><!]]>
They were used for old browsers which didn't understand the <script> tag. That way if a browser didn't properly read the JavaScript, it would just render it as a comment and not show up on the page.
It also allows JavaScript code to be inside valid XHTML pages without having to escape characters which aren't valid in XML.
<![CDATA[//> is to prevent XML parsers from choking on the script.
<!-- ... --> is not required unless you're using Netscape 1.0.