PDA

View Full Version : load javascript last?



fobbie
09-01-2010, 03:34 AM
ok. so this is the javascript that slows my page down, and i would like to call on this javascript after my page is fully loaded. Can someone help please.


<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/twitter.json?callback=twitterCallback2&amp;count=4"></script>

djr33
09-01-2010, 03:45 AM
I don't know what those scripts do and you can't modify them because they are external.
However, the way to accomplish this is simply to place this code toward the end of your <body> section... right above </body> if possible.
But this may involve changing how they are displayed. One option would be using CSS to reposition the elements from the bottom of the page to the top instead, but that might be complex...

The simple answer is that you cannot do it because those are external scripts. Perhaps you could try to load those scripts after dynamically, using some of the methods discussed in this thread, for example. http://www.dynamicdrive.com/forums/showthread.php?t=55727
Note that it isn't easy...

fobbie
09-01-2010, 03:57 AM
thank you.