chris chris - 4 months ago 11
jQuery Question

How to use Google-hosted jQuery UI source?

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 ?

Answer

Yep. It's as simple as that.

 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script>

You could use Google's loader to load it but you don't really need to.

The only real disadvantage to using the min one is that the code is compressed so if you wanted to step through it with a debugger, it would be quite difficult to say the least. The advantages far outweigh this though. In production, I would say by all means use the min one.

Comments