Javasript req?

i just wondered, does anyone know of a javascript that can handle replacing or not loading a item, for instance a picture or a swf, if the source of the server isnt responding, to reduce load/timouts? Theres this queer server that doesnt respond at times, and that creates some timeout issues on the page im doing.

This topic was started by ,


data/avatar/default/avatar03.webp

499 Posts
Location -
Joined 2002-12-18
i just wondered, does anyone know of a javascript that can handle replacing or not loading a item, for instance a picture or a swf, if the source of the server isnt responding, to reduce load/timouts?
Theres this queer server that doesnt respond at times, and that creates some timeout issues on the page im doing.

Participate on our website and join the conversation

You have already an account on our website? Use the link below to login.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


data/avatar/default/avatar03.webp

48 Posts
Location -
Joined 2002-11-16

in body1

<script>

function func1(){
if(flag ==1)return;
obj=eval("document.all.img1");
if(obj == null) return;
obj.src="https://www.warp2search.net/";
obj.alt="sorry";//error message here

}
setTimeout("func1()",timeoutval);



in body2


data/avatar/default/avatar03.webp

499 Posts
Location -
Joined 2002-12-18
OP
ah looks great. thanks a bunch :)

data/avatar/default/avatar01.webp

621 Posts
Location -
Joined 2001-08-26
Does this code also works with loading an other code instead of a picture ?

data/avatar/default/avatar03.webp

499 Posts
Location -
Joined 2002-12-18
OP
as long as you can put a id="xxx" on it, i think it can be used for most things.

data/avatar/default/avatar03.webp

48 Posts
Location -
Joined 2002-11-16
Besides images, the OnLoad event works for embedded objects( shockwave flash objects, applets) and the document (Body tag ) as a whole. But the onLoad event cannot be used for other tags besides the above. You can however alter attributes of all tags using scripting as the document loads