views:

104

answers:

2

Hello. I've been using a very helpful AJAX-based script called AJAXTwits to load multiple Twitter timelines for a sports team into a div. The nice thing about the script is that it (1) combines multiple timelines into one chronological timeline and (2) caches the xml for faster loading. Every so often, though, Twitter's feeds go down, meaning that (i) the caching fails, (ii) the content won't load (I get stuck with the loading message), and (iii) if the problem is big enough, the whole page (not just div) breaks and throws a 404 error.

So, I'd like to add error-handling -- specifically, a pre-written message/div-content that will replace the loading message if the content doesn't load within a set amount of time. I've found some nice examples on this forum on how to handle timeouts. But those deal with a much simpler function/script syntax. Being a cut/paste/emulate programmer, I'm having trouble adapting that.

The main html looks like this:

<ul id='AjaxTwits'>
    <li id='AjaxTwitsLoader'>
        <em>Loading tweets</em>
    </li>
</ul>

<script type="text/javascript">
    getAjaxTwits("AjaxTwits/AjaxTwitsRequest.php", 6);
</script>

Without digging into the script and php files, is there any kind of error/timeout handling that can be placed into this html? Any help appreciated!

+1  A: 

I did not use this script before therefore i can't help you on this, but i can recommend what i've been using for showing twitter messages on my apps.

It is a jquery plugin which you can find here: http://tweet.seaofclouds.com/.

I don't think you will have the same problem, because it uses jquery to make the ajax call. It worths to try.

Hope it helps.

Sinan Y.
A: 

Thank you. That looks like a nice alternative.