First, use a suitable proxy server for recording on your computer (Fiddler2 is fantastic if you are on windows), slide the F5 page until you get an error.
Filter the log for hosts widgets.twimg.com or api.twitter.com ... This will diagnose the point of failure because:
- If the js (or css) request to widgets.twimg.com fails (find 404 or truncated text), then javascript could not get it. It is unlikely that the files should be static.
- If the api.twitter.com request is missing, javascript could not execute.
- If api.twitter.com is being executed, but there is a refusal in the response (a bad answer code or the answer looks successful), then twitter api does not give you a feed.
To detect 1 in javascript, you can detect a failure during loading using a timeout, and onload check that it is loaded (a simple check is that window.twttr exists, but not a great test, because it is installed on top of javascript, therefore only confirms that the javascript syntax is valid and running). (May need onreadystate to determine the load for IE?)
<script src="http://widgets.twimg.com/j/2/widget.js" onload="twitterloaded()"></script>
To detect 2, start the page with the debugger.
In case 3, quickly looking at the code, it looks like this: the code repeats the twitter api requests (you can see the configuration options for api), and it looks like there are api variables to check if everything works, for example TWTR.Widget.isLoaded
_isRunning
and _hasOfficiallyStarted
.
source share