homepage Welcome to WebmasterWorld Guest from 54.234.231.49
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library : Charter : Moderators: whoisgregg

JavaScript and AJAX Forum

    
Javascript timeout for duffers
Asia_Expat




msg:4428389
 1:14 am on Mar 13, 2012 (gmt 0)

Need some help here, and I'm crap with Javascript. The code below is supplied by my private label partner, and I've made a few adjustments to it myself for compliance. However, every now and then, their server goes down. When this happens, it causes my pages to hang, and it never seems to timeout and finish i.e. waits forever for my partner's server to respond. How can I force a timeout of say, one second, or ten seconds, so it just abandons it and continues with the rest of the page?...

<script type="text/javascript" src="http://cache.example.com/mysite/spods.js?locale=en_US&amp;count=8"></script>
<script type="text/javascript">
//<![CDATA[
for (var i = 0, n = wfSPODArray.length; i < n; i++) {
var spod = wfSPODArray[i];
spodHtml = '<a href=' + spod.profileLink + ' target=_self><img src=' + spod.photo.url + ' width=70' +' height=70 ' + '></a>';
document.write(spodHtml);
}
//]]>
</script>

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved