Image onLoad

F

frizzle

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!
 
M

McKirahan

frizzle said:
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. "
 
M

McKirahan

frizzle said:
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.
 
F

frizzle

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.
 
J

Jim Ley

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top