Closed Thread Icon

Preserved Topic: "&&" as part of data (for XHTML)... (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18499" title="Pages that link to Preserved Topic: &amp;quot;&amp;amp;&amp;amp;&amp;quot; as part of data (for XHTML)... (Page 1 of 1)" rel="nofollow" >Preserved Topic: &quot;&amp;&amp;&quot; as part of data (for XHTML)... <span class="small">(Page 1 of 1)</span>\

 
Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 02-05-2002 19:23

Greets!

I have a script that begins:
if ((!document.all) && (!document.getElementById)){

And the XHTML Transitional validator generates an error for each "&" saying:
Error: character "&" is the first character of a delimiter but occurred as data

I'm a little confused as to what that means. The script runs fine, and no other errors are reported by the validator. Can anyone shed some light on this?

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 02-05-2002 19:39

In XHTML, even in script or style tags, ampersands (& mark the beginning of an entity, such as &amp;lt;, or &amp;quot;. So you have to either replace those with &amp;amp;&amp;amp;, or put the script in an outside file (recommended, since the first thing will confuse many older browsers). See http://www.w3.org/TR/xhtml1/ (sections 4.8 and C.4).

hlaford
Bipolar (III) Inmate

From: USA! USA! USA!
Insane since: Oct 2001

posted posted 02-05-2002 19:43

you should wrap stuff like that in CDATA brackets:

code:
<![CDATA[   ...    ]]>



« BackwardsOnwards »

Show Forum Drop Down Menu