Author | Topic: defer and async loading of javascript libraries | |
---|---|---|
Nestor G. Torres | defer and async loading of javascript libraries on Fri, 08 May 2015 12:27:20 +0200 Hi Guy's, Just been testing the "defer" and "async" loading directives of my javascript libraries. It seems to make a difference on the loading of large libraries. why waist time loading javascript libraries that are only needed when an operator starts clicking on things; or are only needed when the web page gets fully loaded. example of defer (if not defer operator could wait 1 to 2 seconds longer for the page to load): <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=XIzpLDznxuPlx- BouS1mYEf5duSm9oYs4I-q28" defer> </script> Read about it here: http://www.w3schools.com/tags/att_script_defer.asp http://www.w3schools.com/tags/att_script_async.asp Test my web page that has a few heavy javascript libs. The starLite web pages are running off a laptop i5 windows 7. My Internet upload line speed is 0.7 megabits per sec...so that means that the initial StarLite is loaded at 0.7 megabit per second. www.starlightdemo.com www.magdasugarart.co.za Kind regards, Nestor |