Tricks

Load Javascript Last – Load JavaScript After Pageload Make Site Faster

Tips on how to load Javascript (advertisement) last after your page loaded, this can help you load your site faster especially you have a lot out site JavaScript.

The most common reason that websites don’t rank good in popular web sites is slower loading time. Often excessive JavaScript on your page is the main reason for this. The page has either too much of JavaScript code or it refers to a lot of third party JavaScript files from different servers (like advertisement server or any other third party widgets you are using). For example: most of the site has the facebook like button, on May 31st, 2012, the Facebook.com was down and made a lot sites loaded slowly. And you may noticed that the facebook changed some of their codes, no matter their site is on or down, the facebook like button will be loaded last, which can help you make your site run faster, however, some other sites don’t use this method, just like twitter and other advertisement sites.

OK, here is an easy way which can help you load the JavaScript last and make your site run fast, these code will load your javascript after your page load.

1. Use the following code to replace your old javescript (advertisement js )

Loading...

2. Then copy and paste the following code to your footer of your site, before the tag.

Your javascript code here

Done! Pretty easy right?

* note: if you have more than 1 js, please change the div ID.