Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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).

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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