Question: why use cdata in javascript?
Answer: CDATA is an XML construct which sets a tag's contents that is normally #PCDATA - parsed character data, to be instead taken as #CDATA, that is, non-parsed character data. It is only relevant and valid in XHTML. It is used in script tags to avoid parsing < and & .