W3C home > Mailing lists > Public > www-validator@w3.org > January 2003

Re: JavaScript messes up validator

From: Brant Langer Gurganus <brantgurganus2001@cherokeescouting.org>
Date: Sat, 04 Jan 2003 23:40:09 -0500
Message-ID: <3E17B729.20107@cherokeescouting.org>
To: "Robert J. Accettura" <robert@accettura.com>
CC: www-validator@w3.org
Robert J. Accettura wrote:

> When the following code is passed through it catches the </object> 
> tag, but doesn't see that one is opened.  Since the code was fine 
> before it was put into a javascript, I think it might be a bug.
>
> <script type="text/javascript" language="JavaScript"><!-- 

Do you know the language tag is deprecated.  Also, the appropriate MIME 
type is application/x-javascript since text/javascript is not a 
registered type.

>     var browserName = navigator.appName;
>     var l1splash = '<object type="application/x-shockwave-flash" 
> data="/gfx/splash.swf" width="391" height="127">'
>     var l2splash = '<img src="noflash.gif" width="200" height="100" 
> alt="" />'
>     var l3splash = '<param name="movie" value="/gfx/splash.swf" 
> /></object>'
>     browserVer = parseInt ( navigator.appVersion );
>     if ( browserName == "Netscape" && browserVer < 5 ) 
> {document.write(l1splash + l3splash);
>     } else {
>         document.write(l1splash + l2splash + l3splash);
>     }
> // --></script>

I don't see why you need this stuff in JavaScript.  Can't you just use 
<object><param><img></object>?  If the browser can't load the object 
then it is supposed to load the child elements after the parameters.

-- 
Brant Langer Gurganus
http://troop545.cjb.net/brant.xhtml


Received on Saturday, 4 January 2003 23:40:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:05 GMT