By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,622 Members | 1,826 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,622 IT Pros & Developers. It's quick & easy.

Image onLoad

P: n/a
Hi there, ijust a quicky:

I was wondering if the following is supported everywhere:
<img src="spacer.gif" width="1" height="1" onLoad="doomething()">

That way i can launch/check a few things before the page has
comleted loading, which is necesary when one uses <body onLoad="">

Hope it's clear.

Thanks!

Jul 23 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"frizzle" <ph********@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi there, ijust a quicky:

I was wondering if the following is supported everywhere:
<img src="spacer.gif" width="1" height="1" onLoad="doomething()">

That way i can launch/check a few things before the page has
comleted loading, which is necesary when one uses <body onLoad="">

Hope it's clear.

Thanks!


A Google search found this link:

http://www.htmlcodetutorial.com/images/_IMG_onLoad.html

"The onLoad event is fired when the image is finished being downloaded. "
Jul 23 '05 #2

P: n/a
Ok, tanks, i guess it's safe to use then..!
Thanks for the fast reply.

Jul 23 '05 #3

P: n/a
"frizzle" <ph********@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Ok, tanks, i guess it's safe to use then..!
Thanks for the fast reply.


Perhaps...

"Unfortunately, onLoad is not a very reliable event handler. Netscape
particularly has trouble firing onLoad when the image is malformed in some
way or if the image is loaded from cache instead of freshly downloaded from
the net."

But loading from cache isn't an issue for you, I gather.
Jul 23 '05 #4

P: n/a
No, but thanks for your concern:
I found a nice flash check which i'm using for a site.
It was actually using document.write if flash was enabled.
I tweaked it a little bit, and now it redirects people to a non-flash
landing page, so there is no problem loading it from cache..

Thanks anyway! :)

Have yourself a fine weekend.

Jul 23 '05 #5

P: n/a
On 4 Mar 2005 07:08:48 -0800, "frizzle" <ph********@hotmail.com>
wrote:
Hi there, ijust a quicky:

I was wondering if the following is supported everywhere:
<img src="spacer.gif" width="1" height="1" onLoad="doomething()">

That way i can launch/check a few things before the page has
comleted loading, which is necesary when one uses <body onLoad="">


What do you want to actually do, if you want to do something after
elements are fully parsed, but before the content is loaded, you can
almost reasonably reliably do it simply by including inline script
after the part you want. You'll want to take normal care that they
are available, but they almost certainly will be.

No need to mess around with unreliable image load methods.

Jim.
Jul 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.