Date: Sun, 15 Feb 1998 13:31:06 -0500 (EST) From: John Fieber <jfieber@indiana.edu> To: Megan McCormack <meganm@asis.com> Cc: Andrew McNaughton <andrew@squiz.co.nz>, www@FreeBSD.ORG Subject: Re: java errors on main page Message-ID: <Pine.BSF.3.96.980215130039.730B-100000@fallout.campusview.indiana.edu> In-Reply-To: <3.0.32.19980214164328.00683c94@asis.com>
next in thread | previous in thread | raw e-mail | index | archive | help
I've never really paid much attention to Javascript, but I did a small bit of homework on the topic this morning. On Sat, 14 Feb 1998, Megan McCormack wrote: > Well, it may solve the problem for Netscape 4.03 on a PowerMac > but it disables the mouseover effect of changing gifs... The gifs > no longer change color. See > http://www.freebsd.org/~meganm/index.html And Andrew McNaughton wrote [clipped from a couple messages]: > Using Netscape 4.03 on a PowerPC mac, The buttons across the top of the > page do not work with javascript turned on. > > putting the javascript on the image rather than the link solves > the problem. > > eg: > > <A HREF="./ports/index.html"> > <IMG NAME="softA" BORDER=0 alt=" Applications " WIDTH="98" HEIGHT="23" > SRC="./gifs/soft0.gif" onMouseover="change('softA','soft',1)" > onMouseout="change('softA','soft',0)"> > </A> Moving the mouse event handlers to the IMG tag, while infinitely sensible for image flipping, is not supported by Netscape--at least the non-mac versions, and according to their own javascript docs. As such, I suspect that doing so just suppresses this symptom: > line 75: > > Browser not defined because the change function never gets called. I suspect the real bug is somewhere in these lines: Name = navigator.appName; Version = parseInt(navigator.appVersion); if (Name == "Netscape" && Version >= 3) Browser = "n3"; else Browser = "n2"; Another approach I've seen is to do something like <script language="JavaScript"> JSLevel = 0; </script> <script language="JavaScript1.1"> JSLevel = 1; </script> Browsers should only parse the script sections they claim compatibility with, but this would have to be carefully tested with a variety of browsers. Also, the language attribute is officially deprecated in HTML 4.0, in favor of the (mandatory) type attribute which takes a mime type such as "text/javascript" but doubt many browsers would do the Right Thing with just that. Incidentally, no W3 version of HTML allows a name attribute on an IMG tag which makes image flipping from another element (eg A) a hassle. If the IMG itself supported onMouseover and friends, you wouldn't really need to name the images. As for > Java script error on line 49: > index0.src = > > ..................^ I have no clue. What shows up there when you view source? It could simply be a bug particular to the Mac netscape...looks like the javascript parser got disoriented. My opinion of javascript sinks yet another notch. :) -john
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980215130039.730B-100000>