Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q81 How can I get the reload of a page to wait until an image has fully downloaded?

irt.org | Knowledge Base | JavaScript | Image | Q81 [ previous next ]

Q81 How can I get the reload of a page to wait until an image has fully downloaded?

You could use one of the onLoad events in body, img, or even frame:

<body onLoad="...">

or

<img src="image1.gif" width="x" height="y" onLoad="...">

or

<frameset ... onLoad="...">

or you could use the image objects complete property in JavaScript 1.1:

<script language="JavaScript1.1"><!--
if (document.images[0].complete) {...}
//--></script>

Where in all the above examples ... could be replaced with something like: location.href='anotherpage.htm'.

Feedback on 'Q81 How can I get the reload of a page to wait until an image has fully downloaded?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.