What is CDATA Tag ?
In the previous tutorial , I have discussed about Useful shortcut keys of Visual studio.Today i am going to tell you a very interesting tag <![CDATA[]]> . Have you ever seen this tag. Don't worry, you won't get surprised by this tag next time whenever you see it.
Basically whenever you use any third party script or plugin you will get this tag followed by some javascript code or any html markup code.Here is the simple example where <![CDATA[]]> is used.
Now the question is What is <![CDATA[]]> and why it is used?
CDATA stand for character data,means whatever the text or symbol occurs between CDATA tag it should be treated as normal charterer.Let us suppose user as write < > in any text between CDATA tag then it should be treated as character ,not as a XML markup.
CDATA insures that whatever occurs in between CDATA tag should not considered as XML markup.(not interpreted as XML). To avoid the character to be interpreted as XML tag , CDATA tag is used.
Difference between CDATA and Comment
Code written between comment section does not considered as a part of document but in case of CDATA all the code written is considered as a part of document.Below example will clear the difference between CDATA and CommentI hope you have liked this tutorial. I would like to have feedback from you. Your feedback, question ,queries or comments are always welcome.
Thanks.
What is CDATA Tag ?
Reviewed by CodiBucket
on
10:17
Rating:
No comments: