What's CDATA ???

windows

Guest
Hi!

Can someone explain me why some people used this:

//<![CDATA[
<!--
...
//-->
//]]>

tBecause it is Character Data (CDATA) although it is not good practice to use the above method for XHTML served as XML because <![CDATA[ ...something... ]]> is the correct method whereas <!-- ...something... //--> is for HTML alone.

Hence why //<![CDATA[ is used by some people for backwards compatibility if they are serving HTML and to answer your question Character Data is none HTML mark-up such as CSS or JavaScript which could be interpreted as mark-up if not placed in a CDATA block.
 
Back
Top