XHTML Strict/w3 Validator question

 
Post new topic   Reply to topic    Aprelium Forum Index -> Off Topic Discussions
View previous topic :: View next topic  
Author Message
Quivis
-


Joined: 28 Jan 2006
Posts: 3

PostPosted: Sun Jan 29, 2006 10:37 am    Post subject: XHTML Strict/w3 Validator question Reply with quote

Way off topic, but here it goes...

Validator says:
***
1. Warning Line 126 column 130: character "<" is the first character of a delimiter but occurred as data.
...ocument.write(Combine() + "'\>e-post\<\/a>");</script></p>
***

...where the sequence "post\<" is what puts up the warning flag. AFAIK I have the code escaped, but what's up with the warning? Validator bug? My fault? Is there another escaping technique?

Here's the actual code:
<script type="text/javascript">
document.write(Combine() + "'\>e-post\<\/a>");
</script>

Thanks.
_________________
Look, Ma! No image!
Back to top View user's profile Send private message
roganty
-


Joined: 08 Jun 2004
Posts: 357
Location: Bristol, UK

PostPosted: Sun Jan 29, 2006 12:06 pm    Post subject: Re: XHTML Strict/w3 Validator question Reply with quote

Quivis wrote:
Way off topic, but here it goes...

Validator says:
***
1. Warning Line 126 column 130: character "<" is the first character of a delimiter but occurred as data.
...ocument.write(Combine() + "'\>e-post\<\/a>");</script></p>
***

...where the sequence "post\<" is what puts up the warning flag. AFAIK I have the code escaped, but what's up with the warning? Validator bug? My fault? Is there another escaping technique?

Here's the actual code:
<script type="text/javascript">
document.write(Combine() + "'\>e-post\<\/a>");
</script>

Thanks.


The way to get around this is to add CDATA tags inside the script tags
so your code above would look like the following:
Code:
<script type="text/javascript">
//<![CDATA[
  document.write(Combine() + "'\>e-post\<\/a>");
//]]>
</script>


this is just one way!

http://developer.mozilla.org/en/docs/Properly_Using_CSS_and_JavaScript_in_XHTML_Documents
_________________
Anthony R

Roganty
| Links-Links.co.uk
Back to top View user's profile Send private message Visit poster's website
Quivis
-


Joined: 28 Jan 2006
Posts: 3

PostPosted: Sun Jan 29, 2006 12:27 pm    Post subject: Reply with quote

Great! Thanks! :-)
_________________
Look, Ma! No image!
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Off Topic Discussions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group