Javasript req?

This is a discussion about Javasript req? in the Warp2search Hang Out category; 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 , . Last reply 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 in our website and join the conversation

You already have an account on our website? To log in, use the link provided below.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This subject has been archived. New comments and votes cannot be submitted.

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