I'm have a need when my page loads to a) Load an image and then b) get the width/height. The problem I'm running into, at least in firefox, is when the image is first loaded, the width/height are reported incorrectly. However, if I refresh the page, and the browser loads from cache, the correct width/heights are recorded.
Here's what I'm doing
var fppImage = $('<img />');
var iH = fppImage.height();
var iW = fppImage.width();
alert(iW + " " + iH);
iW & iH return 24px on the first page load, but subsequent page loads return the correct dimensions of the image
It seems pretty straightforward, but doesn't work as you'd expect in firefox. Can anyone suggest some ideas to actually preload the image?