homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Javascript timeout for duffers

5+ Year Member

Msg#: 4428387 posted 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">
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>';


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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved