By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,776 Members | 1,506 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,776 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.
Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Lee
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>

Jul 23 '05 #2

P: n/a
Hi,

Thanks for the reply. Does this snippet work in FireFox?

Cheers,
Luke Venediger.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3

P: n/a
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.

Jul 23 '05 #4

P: n/a
Lee
Luke Venediger said:

Hi,

Thanks for the reply. Does this snippet work in FireFox?


yes

Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.