I've recently moved a site over to use the Google AJAX Libraries instead of hosting the library js files myself. At the moment I'm using the Google recommended approach:
<script type="text/javascript" src="http://www.google.com/jsapi?key=MYAPIKEY"></script>
<script type="text/javascript">google.load('jquery', '1.3.2');</script>
But it seems a little silly to me to include an extra JavaScript file, just so I can call another script file.
My question is, is there actually any advantage to calling these files via google.load()
as opposed to simply including them via script tag like so:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
My main reasons for using the Google hosted libraries are the speed of their CDN/edge caching systems; am I still getting those benefits if I link directly to the file?