473,320 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Multiple onLoad in Opera

Hi, I need your help.

How to get multiple onLoad in Opera (v.7)?
Example shows what I mean - it works well IE and Mozilla, but not in
Opera :(
(click an image):

<IMG src="http://info.onet.pl/_i/galeria/okulary/15.jpg"
onload="var xx=document.getElementById('xxx');
xx.innerHTML+='<BR>LOADED'"
onclick="this.src='http://info.onet.pl/_i/galeria/okulary/17.jpg'">
<DIV id=xxx>--</DIV>

Is there anything similar to "stateChange" ?

Thanx 4 answers.
--
Krzysiek Studzinski

Jul 23 '05 #1
1 1580


Krzysiek S. wrote:

Example shows what I mean - it works well IE and Mozilla, but not in
Opera :(
(click an image):

<IMG src="http://info.onet.pl/_i/galeria/okulary/15.jpg"
onload="var xx=document.getElementById('xxx');
xx.innerHTML+='<BR>LOADED'"
onclick="this.src='http://info.onet.pl/_i/galeria/okulary/17.jpg'">
<DIV id=xxx>--</DIV>


I think that is a bug in Opera, you might want to file that, visit
http://www.opera.com/support/bugs/.

I don't see a simple workaround, I have tried to add an event listener
with addEventListener but that doesn't fire either if the src is changed.

What you could try is replacing the <img> element with a new one e.g.

function replaceImage (img, newURL) {
if (img.cloneNode) {
var newImg = img.cloneNode(false);
newImg.src = newURL;
img.parentNode.replaceChild(newImg, img);
}
}

<img id="image2"
alt="load test"
onload="alert(event.type);"
src="buttonOff.gif"
onclick="replaceImage(this, 'buttonOn.gif');">
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: andy johnson | last post by:
I made the mistake of "upgrading" to IE6.0 on my windoze 98 laptop. I really wish bill gates would die in a horribly painful accident. Anyway, after much grief, I downloaded Opera and saw true...
6
by: Brian | last post by:
Hi everyone, I'm writing a function (in javascript) that needs to do one thing if the page has not loaded, and another (different) thing if the page has already loaded. I'm looking for a way...
2
by: David Otton | last post by:
Hi, I'm seeing a difference in behaviour between window.onload = f(); and <body onload="f();"> Specifically, window.onload appears to fire before all the elements of the page have been...
2
by: inevercheckthisaddress | last post by:
I can't get Opera to fire an event when an image object's src has loaded. The test code I'm using is this - --------------------------------- window.onload=go function yo() { alert("yo"); }
2
by: Emmanuel | last post by:
Hi, I'm working on a c# web app and require having some code which runs in the page Load event of each page and to be reusable in other web apps. So i decided to use a Class Library which...
2
by: RobG | last post by:
There has been a bit of work done to get an init() function to run when the DOM is complete but before all the images have been downloaded. The idea is to kickoff init() scripts when all the...
1
by: webgour | last post by:
Hello, I would like to create an onload event within my object. The following works fine : function TEST() { this.image= new Image(); } TEST.prototype.Initialize = function()
7
by: Tom Cole | last post by:
IFrames have been used by years for people to accomplish many of the tasks the XMLHttpRequest does for them now...I unfortunately am late in the game and XMLHttpRequest was already out there by the...
0
acoder
by: acoder | last post by:
Problem onload and onunload events do not fire when going back, forward or refreshing the page Browser Opera Example Any code using onload or onunload, e.g. window.onload = init; where...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.