473,586 Members | 2,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image onLoad

Hi there, ijust a quicky:

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

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
5 1912
"frizzle" <ph********@hot mail.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Hi there, ijust a quicky:

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

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
Ok, tanks, i guess it's safe to use then..!
Thanks for the fast reply.

Jul 23 '05 #3
"frizzle" <ph********@hot mail.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Ok, tanks, i guess it's safe to use then..!
Thanks for the fast reply.


Perhaps...

"Unfortunat ely, 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
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
On 4 Mar 2005 07:08:48 -0800, "frizzle" <ph********@hot mail.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="doometh ing()">

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3896
by: TheKeith | last post by:
I'm doing an image cycler but can't figure out why it keeps getting hung up on the third pic in the array? Here is what I have: ---------------------------------------------------------------------------- --------------------------------- <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html;...
5
7608
by: http://links.i6networks.com | last post by:
I need to delay something either an image or a table from loading for 2-5 seconds. So far I have not find a good method. I need the rest of the page, even the codes after the delayed image, to be displayed in real time.
4
5459
by: Ken | last post by:
I would like to measure the fileSize of the image (without uploading it - php). I use: var size_pic = document.getElementById('num1').childNodes.fileSize; alert("size = " + size_pic); which works on IE with one exception. With a first time displayed image, the script displays a size= -1 The image is displayed on the first pass. The...
1
10189
by: Adam Ratcliffe | last post by:
I'm trying to come up with a solution for detecting when an image, loaded by a script, has completely loaded. The Image.onload event is fired after the image has loaded in Firefox but before loading has completed in Internet Explorer. The function where I assign the onload event handler looks like this: var newImage = new Image(); ...
3
9682
by: Dennis Allen | last post by:
Hi. I've been trying to write Javascript code that checking if an image exists. If it doesn't exist, I want to load a known image. I've tried: if (document.images) { var tester=new Image() // public variable tester.onload="cImg('good')" tester.onerror="cImg('bad')" tester.src="http://www.temp.com/image.jpg" }
4
44056
by: zborisau | last post by:
Hey good people, I've been given a problem to solve recently - and stuck with the solution for a good 4 days already. i have a link which leads to popup window. the purpose of that popup window is to redirect user to the one of available servers. so i need to check which server is available. i have decided to download some 1pixel image...
4
1800
by: Mark S. | last post by:
Hello, On a high volume page we have the following JavaScript: img = new Image() img.src = 'http://myserver.com/count.aspx?x=1'; and it works fine, but now we've added: img.onload = myImgLoaded and it fails on IE and FF. The reason being it's not returning a proper
7
3147
by: howardk | last post by:
I'm writing some code that loads a number of images, using the standard mechanism of assigning a src url to a newly constructed Image object, thus invoking the image-load operation. On a successful load, an image.onload handler I've previously assigned will be called. Or should be at any rate. The problem is that I need to know inside the...
3
2881
by: RK | last post by:
Is there an image handling guru out there than can help a newbie with understanding dynamic image creation? The question: I can create an image from within Javascript with MyPic = new Image() ....and then assign a source with MyPic.src = "./picture.gif";
1
3385
by: neovantage | last post by:
Hey all, I am using a PHP script which creates headings at run time in a sense at page execution. I am stuck a with a very little problem which i am sure i will have the solution from experts. The problem is when it creates transparent PNG format image then and it pixel ate the image. e.g. If i am using a gradient in background then it...
0
7911
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8215
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3836
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1448
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.