Forum Moderators: open

Message Too Old, No Replies

CDATA allowed in HTML 4.01 strict

CDATA HTML 4.01 strict

         

webaster

1:29 am on Mar 13, 2005 (gmt 0)

10+ Year Member



<script type="text/javascript">
//<![CDATA[

is CDATA allowed in HTML 4.01 strict

Bernard Marx

2:10 am on Mar 13, 2005 (gmt 0)

webaster

1:41 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



CDATA is a sequence of characters from the document character set and may include character entities. User agents should interpret attribute values as follows:
Replace character entities with characters,

Ignore line feeds,

Replace each carriage return or tab with a single space.

webaster

1:46 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



<script type="text/javascript">
//<![CDATA[

Your script ....

//]]>
</script>

correct syntax?

webaster

1:56 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



good read about cdata

[flightlab.com...]

webaster

2:05 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



better use cdata than merely comments?

implicates more browsers will read the code better?

Rambo Tribble

3:09 pm on Mar 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In the cold dose of reality department: There are more version 4 browsers out there than version 7.

webaster

3:18 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



cdata better or comments?

webaster

3:35 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



all I need to know is: is it perfectly safe to use CDATa in combination with HTML 4.01

Bernard Marx

4:09 pm on Mar 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you are using HTML 4, then I don't believe you need CDATA tags.

webaster

4:19 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



but you can use CDATA safely in HTML 4.01 without producing parsing errors?

Bernard Marx

4:36 pm on Mar 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Many people suggest hiding the markers from jaavascript by using single line comments, which are already doing. If you do that, I can't see a problem.

webaster

5:06 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



have an example - without seeing the code too difficult to understand-

webaster

5:08 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



So again using HTML 4.01 strict

This is ok too use? yes or no?

<script type="text/javascript">
//<![CDATA[

Your script ....

//]]>
</script>

Bernard Marx

5:28 pm on Mar 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can't see why not, but as I suggested before, you could take this to the HTML forum for confirmation from someone who knows what they're talking about.