‘Image’ is undefined Javascript Error in IE

The built-in browser object "Image" is sometimes reported as undefined on pages viewed in IE. I've done extensive research online, but all leads point to browser addons/plugin in combination of calling that page in a pop-up window as the likely culprit. No solutions were found and I'm feeling that none were ever offered.

This error seems to be triggered by the JavaScript expression, "new Image" as in the following statement:

var myImage = new Image();

I'm stumped. Why would IE complain about a built-in object? It doesn't make sense.

One thought on “‘Image’ is undefined Javascript Error in IE

  1. I have the same problem i have made an image gallery with next button and when i click this text is load here is the code,please help:

    string=0;
    images=new Array();
    images[0]=”5.jpg”;
    images[1]=”bild.jpg”;
    images[2]=”a.jpg”;

    preload=new Array(3)

    for(i=0;i<images.lenght;i++){
    preload[i]=new Image(120,120)
    preload[i].src=images[i]
    }
    function Number() {
    pet=document.getElementById("id");
    pet.innerHTML="image" + eval(string+1) +"of" + images.lenght;
    }
    function Next() {
    if(string<images-1) {
    string=string+1
    document.pas.src=preload[string].src
    }
    else{
    alert("something gone wrong")
    }
    Number();
    }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s