Image.onload doesnt work at all for IE
<pre><code>var icon1 = new Image();
var wid1;
var hei1;
icon1.src = resource;                   // resource is Image URL here
icon1.onload = function () {
    wid1 = icon1.width;
    hei1 = icon1.height;
    var rati = wid1 / hei1;
};
</code></pre>

<p>This code is to calculate the ratio of width and height to further maintain the aspect ratio of the image but it doesn't work at all on IE. is there anything else that i can use for maintaining the aspect ratio of image that will work on all browsers?</p>
