javascript - Does the Google AJAX API Loader have any advantage over direct link to Google hosted files via script tag? -
I recently transferred a site to use Google AJAX libraries instead of hosting a library js files I am currently using Google's recommended approach:
& lt; Script type = "text / javascript" src = "http://www.google.com/jsapi?key=MyAPIKEY" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; Google.load ('jquery', '1.3.2'); & Lt; / Script & gt;
But I think I'm a little silly to include an additional JavaScript file, just so that I can call another script file.
My question is that there is really any advantage to calling these files through google.load ()
, such as through the script tag Similarly to include:
& lt; Script type = "text / javascript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" & gt; & Lt; / Script & gt;
My main reason for using Google hosted libraries is the speed of their CDN / Edge caching system; Am I still receiving those benefits if I link directly to the file?
The main benefit API for using the loader is that when you start downloading by the browser Block will stop. Browser only supports 2 & amp; There are 10 things at one go, so if blocked, this will give a bad user experience.
It has done a lot of research to get the fastest websites, Nick Jacques (Javascript Guru), Steve's ideas Blogs about using
Comments
Post a Comment