开发者

Is this non minified version of jQuery up on Google?

开发者 https://www.devze.com 2022-12-21 19:15 出处:网络
During development, I use this to load the latest jQuery: <script src=\"http://www.google.com/jsapi\"></script>

During development, I use this to load the latest jQuery:

<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("jquery", "1");
</script>

But dur开发者_如何学Pythoning development, I'd like to use the non-minified version.


This should do it

google.load("jquery", "1", {uncompressed:true});


You could simply include

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>

Alternatively, you can add the uncompressed parameter:

google.load("jquery", "1", { uncompressed: true });

You can even switch automatically:

google.load("jquery", "1", { uncompressed: location.host === "dev.yourdomain.com" });


During development, why not host it yourself and then move to the Google-hosted minified jQuery?

After all, the impetus for using Google is to reduce initial-load latency for jQuery and during development that isn't really an issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消