3

When using Google's JSAPI Auto-Loading system - is there a way to get the returned file with all the JavaScript (combined) in one HTTP request?

At the minute is just calls the load routines (with more HTTP requests) at the end of returned file, which makes it less than ideal when it can reduce 2+ requests by just including the returned JavaScript content all in one.

1

No. The AutoLoading option seems more about decreasing the number of requests you have to make to the Google service, rather than about decreasing the number of returned scripts and files from Google.

I don't see an option to concatenate the returned files as of this writing (16 July 2010).

0

I have personally stopped using Google's auto loading because of the additional request and I've found very few other benefits. Instead I just include the JS and files directly. You can find the tags at this site.

Here is the code I use for jQuery:

<link href="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/blitzer/jquery-ui.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/i18n/jquery-ui-i18n.min.js"></script>

It's nice of Google to also include the jQuery UI CSS as well as the referenced images.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.