That action is asynchronous; a lot of image 'pre-loading' code relies on that feature.
EDIT: To give a little bit more useful information as well. If you're wanting to have certain actions synchronously wait for images to load via javascript's image object, you can use the onload event, like so:
var img = new Image();
img.onload = function () { /* onLoad code here */ };
img.src = 'xxxxxx';
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…