Alex Rivera | Logout

How to use Google-hosted jQuery UI source?

Asked 2009-07-20T06:36:01.307
26

I need to load the jQuery UI files, and would like to do it from Google. Currently I upload:

<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.draggable.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.droppable.js"></script>

What are the corresponding files I need from Google?

Can I use http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js?

Also, is there any disadvantage in using this one instead: http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js ?

Edit
Report

1 Answer

11

The previous answer gives you a link to a specific version of jqueryui but your question implies that you'd like the Google-based links to the latest versions. These are the correct src's:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>

I see that we're up to version 1.9x at the time of writing. I don't know if the "1" in Google's links will change to a "2" if/when we reach jquery v2. The above links will give you the latest files, anyway, in version 1.

This method doesn't seem to be documented on Google's hosted libraries page, so use with caution. Also the various extra libraries such as draggable / droppable that you've referred to don't seem to be hosted on Google.

See: https://developers.google.com/speed/libraries/devguide?hl=fr#jquery

answered 2013-01-22T11:00:01.237

Your Answer