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

L

Luke Venediger

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','Images/BTN_profile.jpg',1)">

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

Thanks,
Luke Venediger.
 
L

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','Images/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','Images/BTN_profile.jpg',1)">
</body>
</html>
 
L

lukev123

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top