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 El_Coyote, . Last reply by vicente,
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.
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
This subject has been archived. New comments and votes cannot be submitted.
Responses to this topic
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
OP
ah looks great. thanks a bunch :)
Does this code also works with loading an other code instead of a picture ?
OP
as long as you can put a id="xxx" on it, i think it can be used for most things.
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