开发者

Firefox 3.6.x does not fire off my onload event

I have a Firefox 3.6.2 problem (3.5.x works just fine).

This is the code:

...
var newImage = new Image();
newImage.onload=function() {swapMapImg(newImage);};
newImage.src = newBackground;
...

function swapMa开发者_如何转开发pImg(newImage) {
    alert('bingo');
}

Firefox 3.6.2 no longer fires off my onload event, any ideas?


I would personally start using jQuery if you can and use their onload functions. It should make life a LOT easier for you as someone else is maintaining and testing the code


Turns out the following code:

var currentBackground = tableElem.style.backgroundImage;

returns two different strings in 3.5.x and 3.6.x as shown below:

3.5.x --> url(http://localhost:8080/WellSeismicMap/......);

3.6.x --> url("http://localhost:8080/WellSeismicMap/......");

notice the quotation mark in char position 4 in the 3.6.x version well this was throwing my substr function out and generating an invalid url.

Thanks for your help anyway chaps!


I'm using Firefox 3.6.2 and your code works for me. Are you sure:

newImage.src = newBackground;

Is working? I mean, do you still see the image appear on the page? Because if the link's broken, onload isn't going to happen.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜