Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | JavaScript | Image | Q81 [ previous next ]

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?'

©2018 Martin Webb