| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| Quivis -
 
 
 Joined: 28 Jan 2006
 Posts: 3
 
 
 | 
			
				|  Posted: Sun Jan 29, 2006 10:37 am    Post subject: XHTML Strict/w3 Validator question |   |  
				| 
 |  
				| 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 |     | 
	
		|  | 
	
		| roganty -
 
 
 Joined: 08 Jun 2004
 Posts: 357
 Location: Bristol, UK
 
 | 
			
				|  Posted: Sun Jan 29, 2006 12:06 pm    Post subject: Re: XHTML Strict/w3 Validator question |   |  
				| 
 |  
				|  	  | 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 |       | 
	
		|  | 
	
		| Quivis -
 
 
 Joined: 28 Jan 2006
 Posts: 3
 
 
 | 
			
				|  Posted: Sun Jan 29, 2006 12:27 pm    Post subject: |   |  
				| 
 |  
				| Great! Thanks! :-) _________________
 Look, Ma! No image!
 |  | 
	
		| Back to top |     | 
	
		|  | 
	
		|  |