I noticed an error, when Twitter was down like 20 minutes a few days ago. In some browsers, my page wouldn't entirely load, because it couldn't load the twitter feed. Of course, I don't want my uptime to be depending on the uptime of Twitter so I want to fix this. When I checked out the code of my wordpress theme I found that it's loading javascript on the middle of the page. That's why it probably got stuck, since it couldn't download the right files? Here is the code:
<a href="http://twitter.com/<?php echo $username ?>" class="twitter-link"></a>
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/<?php echo $username ?>.json?callback=twitterCallback2&count=<?php echo $postcount ?>"></script>
Of course there is a lot more code to this widget, but I believe this is the important part. Can I split this up that the loading is done at the bottom of the page? That way the visitor can still see my webpage right?
Thanks!
bodythe page will load (mostly) but the document ready still won't fire. The only way to make sure your page will fully work independent of 3-rd party scripts is to load them dynamically after your page is loaded (after document ready).