I know this is a really dumb question, but I see this sometimes in scripts in a page. I'm curious. Inside it's just normal script, and you can have script without it, so, can anyone help a newbie understand this?
Its for XHTML (and canonical JSP, for the same reasons) compliance.
Since XHTML has to be valid XML things like less-than greater-than comparisons can make a page invalid.
CDATA is used to embed raw data in XML documents, the "//" characters just hide it from the javascript interpreter.
__________________ Please login or register to view this content. Registration is FREE
It's a XML element.CDATA means character data. XML CDATA is text that will not be parsed by a parser. Tags inside the text will not be treated as markup and entities will not be expanded. try this link to know more: http://www.w3schools.com/xml/xml_cdata.asp