Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > <img onload= does not work in FireFox 1.0 but works in IE

Reply
Thread Tools

<img onload= does not work in FireFox 1.0 but works in IE

 
 
Luke Venediger
Guest
Posts: n/a
 
      03-08-2005
Hi there,

Please help. I cannot get a javascript function to be called from an
img tag when the page loads. Here is a snippet of my code, and I'm
trying to call the MM_nbGroup function, but this is not working in
FireFox, only IE.

My function is there (so not missing).

<img src="Images/BTN_profile_over.jpg" name="profile" border="0"
id="Image1" onload="MM_nbGroup('init','group1','profile','Imag es/BTN_profile.jpg',1)">

Is there another way to call a function when an image loads? Please
help! Getting desperate!

Thanks,
Luke Venediger.
 
Reply With Quote
 
 
 
 
Lee
Guest
Posts: n/a
 
      03-08-2005
Luke Venediger said:
>
>Hi there,
>
>Please help. I cannot get a javascript function to be called from an
>img tag when the page loads. Here is a snippet of my code, and I'm
>trying to call the MM_nbGroup function, but this is not working in
>FireFox, only IE.
>
>My function is there (so not missing).
>
><img src="Images/BTN_profile_over.jpg" name="profile" border="0"
>id="Image1"
>onload="MM_nbGroup('init','group1','profile','Ima ges/BTN_profile.jpg',1)">
>
>Is there another way to call a function when an image loads? Please
>help! Getting desperate!


Whatever is "not working" is in the function MM_nbGroup() or elswhere in code
that you haven't shown us.

The following test shows that the function is called:

<html>
<head>
<script type="text/javascript">
function MM_nbGroup(a,b,c,d,e,f) {
alert(a+"\n"+b+"\n"+c+"\n"+d+"\n"+e+"\n"+f);
}
</script>
</head>
<body>
<img src="Images/BTN_profile_over.jpg"
name="profile"
border="0"
id="Image1"
onload="MM_nbGroup('init','group1','profile','Imag es/BTN_profile.jpg',1)">
</body>
</html>

 
Reply With Quote
 
 
 
 
Lee
Guest
Posts: n/a
 
      03-08-2005
Luke Venediger said:
>
>Hi,
>
>Thanks for the reply. Does this snippet work in FireFox?


yes

 
Reply With Quote
 
lukev123@gmail.com
Guest
Posts: n/a
 
      03-08-2005
Hi Lee,

Thanks for the response - you are correct, this function works fine in
IE and FireFox. Back to the drawing board.

Cheers,
Luke Venediger.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript works in IE but not work in Firefox fatihari@gmail.com Javascript 2 06-22-2006 04:22 AM
Form does not work in firefox, but works in IE sipuebla@gmail.com Javascript 4 10-17-2005 01:32 PM
does not work on freeBSD but works on linux, and windows John fabiani Python 14 07-02-2004 04:23 PM
Webservice works once and then DOES NOT seem to work even though program does not crash Phi! ASP .Net Web Services 1 04-23-2004 08:42 AM
Why this javascript function does not work on IE5, but works on IE6? Andrzej Javascript 0 10-06-2003 04:21 PM



Advertisments