|
Posted by cwdjrxyz on 10/13/06 17:55
> <script language=javascript>
The above script tag will produce a validation error at the W3C
validator, at least for html 4.01 and above. The correct tag is <script
type="text/javascript">. Language is no longer required, and may give
an error in higher levels of xhtml if used in addition to type. The
type is a must now. However most browsers still will work with the
script tag as written by you.
> if(typeof(YAHOO)!='undefined') {
> document.write('<map name="yodel"><area shape="rect"
> coords="209,30,216,39" href="http://www.yahoo.com"
> onclick="callYodel();return false;"><area shape="poly"
> coords="211,0,222,1,215,26,211,25" href="http://www.yahoo.com"
> onclick="callYodel();return false;"></map><div id=l_fl
> style="position:absolute"></div>');
The close division in the line above is in a document.write within a
script and thus must be backslashed as <\/div>. This applies to all
types of closing tags in a document.write. A page often will work if
this is not done, but the W3C validator finds not backslashing to be a
validation error, which is correct. The reasons are rather complicated.
Check the FAQ/help tab at the W3C validator and go to the section on
javascript for links that will tell your more. Also the close map in
the above script fragment needs to be backslashed, because the map tag
is also in the document.write.
> var
> lr0='http://us.ard.yahoo.com/SIG=12ldjm870/M=386734.8419383.10128039.8161384/D=yahoo_top/S=2716149:HEADR/_ylt=AvUcvHNGNK1Q6pPO8Dm0HRv1cSkA/Y=YAHOO/EXP=1160765162/A=3912593/R=0/*';
> var lcap=0,lncap=0,ad_jsl=0,lnfv=6,ylmap=0;
> var ldir="http://us.i1.yimg.com/us.yimg.com/i/mntl/ww/06q3/";
> var swfl1=ldir+"yodel.swf";
> var swflw=1,swflh=1;
> }
> ...
> </script>
I did not examine your code in great detail and could have missed some
other problem. If you still have problems, please post details. If you
do not get what you need from this thread after a reasonable time, you
might consider posting in the Usenet group comp.lanf.javascript.
[Back to original message]
|