Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- document.write Syntax Problem in Remote Javascript


andreasfriedrich - 5:51 pm on Nov 11, 2002 (gmt 0)


You do not need the <![cdata[ section in external javascript files.

In XHTML script elements are declared as having #PCDATA content, i.e. < and & will be treated as the start of markup. With <![cdata[ you tell the xml parser within the browser that the content is #CDATA, i.e. that it should not be parsed by the parser but should be treated as character data instead. Since most browsers do not support the <![cdata[ instruction you need to hide it with the javascript comments.

Again, this only applies to inline scripts. It is not neccessary for external scripts.

Andreas


Thread source:: http://www.webmasterworld.com/javascript/224.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com