tags:

views:

85

answers:

2

jQuery, Cufon, fonts, jQuery plugins, and JavaScript code, are at the top of a page. The Javascript code is all wrapped in a document.ready(). Two Twitter scripts, one the actual script and one the JSON, are at the beginning.

A problem that is going on is that I have found out that even placing the scripts at the bottom of the page, Twitter scripts delay all other scripts from running because they have been wrapped in a document.ready.

One solution to this I can see is taking the document.ready() off of the functions and moving them to the bottom of the page, before Twitter. Is there a better way to do this?

A: 

defer="defer" ?

Cherian
A: 

If execution speed is not critical, you can try setTimeout to call the Twitter script.

Example:

$(document).ready(function(){

  setTimeout(callTwitterFunction, largeNumberEnoughForOtherScriptToFinishLoading)

});
Adrian Godong