Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

works in ie, not in Netscape

0 views
Skip to first unread message

tga...@my-dejanews.com

unread,
May 18, 1999, 3:00:00 AM5/18/99
to
i'm having problems doing a simple mouseover in
netscape. it works fine in IE4/5 but doesn't work
in netscape. here's the code i'm using:

browser_name = navigator.appName;
browser_version =
parseFloat(navigator.appVersion);

if(browser_name == "Netscape" &&
browser_version >= 3.0) { roll = 'true';}
else if (browser_name == "Microsoft Internet
Explorer" && browser_version >= 4.0) { roll =
'true';}
else { roll = 'false'; }


function msover1(img,ref) { if (roll == 'true')
{ document.images[img].src = ref; } }
function msout1(img,ref) { if (roll == 'true')
{ document.images[img].src = ref; } }
...
...
<td><p align="center"><a href="index.html"

onmouseover="msover1('home','images/homeOV.bmp');"

onmouseout="msout1('home','images/home.bmp');"><im
g
src="images/home.bmp" alt="Home"
border="0" width="76"
height="15" name="home"> </a></p></td>


any help would be greatly appreciated.


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---

Tait Milliken

unread,
May 19, 1999, 3:00:00 AM5/19/99
to tga...@my-dejanews.com
Netscape is less forgiving when it comes to what some might consider
"minor" errors in coding. Your "onmouseover" and "onmouseout" statements
should be written as "onMouseOver" and "onMouseOut" -- note the
capitalization. Javascript is (supposed to be) sensitive to such
capitalization errors. I guess that IE is non-conforming in that
respect.

HTH

Jay Rossiter / Signe

unread,
May 19, 1999, 3:00:00 AM5/19/99
to

Tait Milliken <jtmil...@rvjintl.com> wrote in message
news:3742FBAD...@rvjintl.com...

> Netscape is less forgiving when it comes to what some might consider
> "minor" errors in coding. Your "onmouseover" and "onmouseout" statements
> should be written as "onMouseOver" and "onMouseOut" -- note the
> capitalization. Javascript is (supposed to be) sensitive to such
> capitalization errors. I guess that IE is non-conforming in that
> respect.

HTML is caseless. HTML is *supposed* to be read regardless of casing.
<A OnMOUSEover="alert()"> is the same as <A onMouseOver="alert()"> or <A
onmouseover="alert()"> ...

Events linked to HTML elements are caseless, just as the language that
the attribute is written in is supposed to be. If Netscape requires
camelcasing on their HTML attributes, then there's something wrong with
*their* spec.

Antoni Biliardis

unread,
May 20, 1999, 3:00:00 AM5/20/99
to
onmouseover, ONMOUSEOVER, oNmOUSEOVER or any other combination of
upercase/lowercase ought to work with any browser since it is the HTML
attribute that triggers an event.
HTML tags and attributes ARE case INSENSITIVE and NN works according to W3C
specifications.
The problem is that you are asking NN to render a bitmap image.
It ain't gonna happen!!!
NN renders ONLY .gif and .jpg images. NN4+ might render .png images also,
although I never tried it.

Hope this helps....

~8^)

--
_____________________________________________________________
B&D Technologies
http://www.bd-tech.com
Antoni Biliardis - ant...@bd-tech.com

Tait Milliken wrote in message <3742FBAD...@rvjintl.com>...


>Netscape is less forgiving when it comes to what some might consider
>"minor" errors in coding. Your "onmouseover" and "onmouseout" statements
>should be written as "onMouseOver" and "onMouseOut" -- note the
>capitalization. Javascript is (supposed to be) sensitive to such
>capitalization errors. I guess that IE is non-conforming in that
>respect.
>

Erik Jan Tromp

unread,
May 20, 1999, 3:00:00 AM5/20/99
to
On Tue, 18 May 1999 10:03:34 GMT, tga...@my-dejanews.com broke his
favourite crayon while scribbling:

>i'm having problems doing a simple mouseover in
>netscape. it works fine in IE4/5 but doesn't work
>in netscape. here's the code i'm using:

<snip>

>onmouseover="msover1('home','images/homeOV.bmp');"
>
>onmouseout="msout1('home','images/home.bmp');"

I haven't tried the script locally, but the first thing I'd attempt is
turfing the bmp's. Think of them as an "MS only" deal. Assuming the
rest of the script is viable, converting the images to jpg's or gif's
should set things right.
BTW, I read one of the replies to this message commenting on the case
sensitivity of "onmouseout/onmouseover". I've used the tags in all
uppercase on my mess... MSIE, NN, & Opera don't seem to mind in the
slightest. Strange.

Erik Jan Tromp
London, Ontario, Canada
ejt...@yahoo.com
http://www.execulink.com/~gloriae/

"If I wanted to hear the pitter-patter of little feet, I'd put shoes on my cat."

0 new messages