Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Javascript timeout for duffers



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

5+ Year Member

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>';

Featured Threads

Hot Threads This Week

Hot Threads This Month