Hello,
I've had long standing code that runs in IE, that I'm testing with
firefox unsuccessfully now. The problem seems to be that images that I
dynamically create don't fire their onload event in firefox. The
onload method I assign is never being called. Any ideas why firefox
isn't calling this, or what I can do for a workaround?
Below is approxiatemate code of what I'm doing...
function addImage(obj,is True){
alert('add');
alert(obj.id);
// do stuff
}
function main(){
var imageObj = new Array();
var image_src = '/images/someKnownImage. jpg';
var somethingIsTrue = true;
imageObj[imageObj.length] = new Image();
imageObj[imageObj.length-1].id = id;
if(somethingIsT rue){
imageObj[imageObj.length-1].onload = function() {
addImage(this,' true'); }
} else {
imageObj[imageObj.length-1].onload = function() {
addImage(this,' false'); }
}
imageObj[imageObj.length-1].src = image_src;
}
I've had long standing code that runs in IE, that I'm testing with
firefox unsuccessfully now. The problem seems to be that images that I
dynamically create don't fire their onload event in firefox. The
onload method I assign is never being called. Any ideas why firefox
isn't calling this, or what I can do for a workaround?
Below is approxiatemate code of what I'm doing...
function addImage(obj,is True){
alert('add');
alert(obj.id);
// do stuff
}
function main(){
var imageObj = new Array();
var image_src = '/images/someKnownImage. jpg';
var somethingIsTrue = true;
imageObj[imageObj.length] = new Image();
imageObj[imageObj.length-1].id = id;
if(somethingIsT rue){
imageObj[imageObj.length-1].onload = function() {
addImage(this,' true'); }
} else {
imageObj[imageObj.length-1].onload = function() {
addImage(this,' false'); }
}
imageObj[imageObj.length-1].src = image_src;
}
Comment