Forum Moderators: open

Message Too Old, No Replies

WC3 Transitional

         

jayrock911

9:27 pm on Feb 19, 2008 (gmt 0)

10+ Year Member



I have a banner from weather.com. Of course they don't care if anything is valid but I do.

Here is the code with the problem:

document.write('<scr'+'ipt src="'+document.location.protocol+'//wow.weather.com/weather/wow/module/'+wx_locID+'?config='+wx_config+'&amp;proto='+document.location.protocol+'&amp;target='+wx_targetDiv+'"></scr'+'ipt>');

Here are the errors I'm getting:

Line 214, Column 23: an attribute specification must start with a name or name token.
document.write('<scr'+'ipt src="'+document.location.protocol+'//wow.weather.c&#9993;
An attribute name (and some attribute values) must start with one of a restricted set of characters. This error usually indicates that you have failed to add a closing quotation mark on a previous attribute value (so the attribute value looks like the start of a new attribute) or have used an attribute that is not defined (usually a typo in a common attribute name).

Line 214, Column 23: element "scr" undefined.
document.write('<scr'+'ipt src="'+document.location.protocol+'//wow.weather.c&#9993;
You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by:

incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "<frameset>" element),
by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead).
by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case).

Line 214, Column 211: delimiter "'" invalid: only S separators and TAGC allowed here.
…+'&amp;target='+wx_targetDiv+'"></scr'+'ipt>'); &#9993;
Line 214, Column 23: XML Parsing Error: error parsing attribute name.
document.write('<scr'+'ipt src="'+document.location.protocol+'//wow.weather.c&#9993;
Line 214, Column 23: XML Parsing Error: attributes construct error.
document.write('<scr'+'ipt src="'+document.location.protocol+'//wow.weather.c&#9993;
Line 214, Column 23: XML Parsing Error: Couldn't find end of Start Tag scr line 214.
document.write('<scr'+'ipt src="'+document.location.protocol+'//wow.weather.c&#9993;
Line 214, Column > 80: XML Parsing Error: expected '>'.
…nt.location.protocol+'//wow.weather.com/weather/wow/module/'+wx_locID+'?confi…&#9993;
Line 214, Column > 80: XML Parsing Error: Opening and ending tag mismatch: script line 196 and scr.
…nt.location.protocol+'//wow.weather.com/weather/wow/module/'+wx_locID+'?confi…&#9993;
Line 215, Column 9: XML Parsing Error: Opening and ending tag mismatch: div line 184 and script.
</script>&#9993;
Line 248, Column 6: XML Parsing Error: Opening and ending tag mismatch: body line 15 and div.
</div>&#9993;
Line 249, Column 7: XML Parsing Error: Opening and ending tag mismatch: html line 2 and body.
</body>&#9993;

I would really be greatful for any help.

le_gber

11:54 am on Feb 20, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi jayrock911 and welcome to webmasterworld [webmasterworld.com]

Presumably you have that code inside another javascript tag? If you do, simply add the CDATA tags that will tell the validator to ignore everything inside:

<script type="text/javascript">
/* <![CDATA[ */
document.write('<scr'+'ipt src="'...'");
/* ]]> */
</script>

jayrock911

4:19 pm on Feb 20, 2008 (gmt 0)

10+ Year Member



It worked great!

Thank you so much. Yes it was inside the tags so I just used the code.

I really appreciate your help.

I'm always a student in this game....

Jayrock

fside

8:11 pm on Feb 20, 2008 (gmt 0)

10+ Year Member




simply add the CDATA tags

Is there another way for him to do this other than using document.write?

le_gber

8:30 am on Feb 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there another way for him to do this other than using document.write?

yes possibly hard coding the whole js source, or putting everything in a function and a var. I am not too familiar with the weather.com banner though.