onlycode.org

javascript
jquery
html
css
angularjs
node.js
ajax
html5
php
json
arrays
google-chrome
dom
regex
reactjs
ecmascript-6
javascript-events

your's history:
image onload not firing...

image.onload not firing twice in IE7, just only code

internet-explorer-7 | javascript-events | javascript

edit
var availablePages = ['1002_001','1002_002','1002_003','1002_004','1002_005'];

function seePage(index) {
    $get('imgSingle').src = 'graphics/loading.gif';
    var img = new Image();
    img.onload = function() {
         var single = $get('imgSingle');
         single.src = img.src;
    }
    img.src = 'get.jpg.aspx?size=single&id=' + availablePages[index];
}

26
Ian Elliott, 24.06.2009 16:35




edit
var img = new Image();
img.src = 'foo.jpg';
if(img.complete){
    img.onload = function(){ /* ... */ };
} else {
    /* execute something else, or the same. */
}

25
sholsinger, 08.01.2010 18:51

Add your just only code

your name:    



If you need full text click here

Some similar links image.onload not firing twice in IE7 ↓:
img onload doesn't work well in IE7

window.onload() is not firing with IE 8 in first shot

, image onload() doesnt fire in webkit if loading same image

Image onload event binding



This project is created for those who just need only code, wihout maaaaaaaaaaany words.