var l = false;
var l2 = false;
var imm = new Image();
imm.src = \"b.png\";
imm.onload = function(){
l = true;
}
var imm2 = new Image();
imm2.src = \"c.png\";
imm
you don't have to constantly check, just check the other each time one finishes, that way, when the second is done your function will fire, and you will only have had to "check" once. var l = false; var l2 = false;
var imm = new Image();
imm.src = "b.png";
imm.onload = function(){
l = true;
if (l2)
call yourFunction();
}
var imm2 = new Image();
imm2.src = "c.png";
imm2.onload = function(){
l2 = true;
if (l)
call yourFunction();
}