English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

In XML scripting, what is the difference between
<--This is a comment-->
and
This is a comment
]]>

2006-09-09 03:52:40 · 3 answers · asked by hicksvilleny 2 in Computers & Internet Programming & Design

3 answers

By the way, the correct syntax is

That was a comment; as it indeed is, but CDATA is not, it is processed text string similar to

 but with broader and wider meaning. I think the content of it would be go into an XML parser and that is contrary to what comments should do.

And thinking of XML as scripting is likely get you nowhere, it is a Markup not Script.

2006-09-09 06:58:53 · answer #1 · answered by Andy T 7 · 0 1

there are many bad hacks to hide javascript in html files, especially in very old or stupid browsers.

putting a script in a cdata or putting the cdata is comments, was a bad solution to a sloppy kludgy problem.

the best solution in the past was to put the js in a separate file.


modern browsers (even old IE) handle this without these horrid kludges.

ps
the cdata is never a comment. just ingnored stupidly!

2006-09-10 17:15:04 · answer #2 · answered by jake cigar™ is retired 7 · 0 0

the difference between these is two is parser
<--This is a comment--> is a normal HTML and parssed by any html browser while


is xml and can only be parssed by an XML parser.

2006-09-09 11:52:31 · answer #3 · answered by Asif 1 · 1 1

fedest.com, questions and answers