recently i’ve got a problem with few lines of javascript code:
obj = new Image()
obj.src =_imageToShow;
obj.onload = function loaded()
{
// do something..
}
In Internet Explorer 6 o 7, if the image is already in cache the loaded function isn’t called.
In Firefox or other (decent) browsers you do not experience this problem.
This is because Internet Explorer throws the onload event immediately if the image is already in cache.
To avoid this problem you have to exchange the order of the 2 lines about src and onload assignment:
obj = new Image()
obj.onload = function loaded()
{
// do something..
}
obj.src =_imageToShow;


AINUR / music from tolkien's silmarillion
ARKIDEA / italian design for jewelry stores
HOUSE OF MUSIC / Scuola di Musica
MEDIACOM / AV 3D post prod
TFLOW TUCANNA / PDF Workflows
UMAMU / give for free!
WILLBIT / idee per creare il futuro
ZENTAO / body mind wellness
1 comment
Daneel says:
Jan 9, 2012
Thank you! you have solved a similar problem i have encountered with internet explorer.
Bye!