Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
//<![CDATA[ - What is this?
Old 03-14-2007, 04:57 PM //<![CDATA[ - What is this?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
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?
Learning Newbie is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-14-2007, 05:26 PM Re: //<![CDATA[ - What is this?
willcode4beer's Avatar
Super Moderator

Posts: 1,533
Name: Paul Davis
Location: San Francisco
Trades: 1
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

willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 03-17-2007, 03:47 AM Re: //<![CDATA[ - What is this?
jito's Avatar
MY LIFE IS 'i' LIFE

Posts: 565
Name: surajit ray
Location: inside the heart of my friends
Trades: 0
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
jito is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to //<![CDATA[ - What is this?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12714 seconds with 12 queries