Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Google-hosted jQuery UI source?

Tags:

jquery

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 ?

like image 448
chris Avatar asked Jul 20 '09 06:07

chris


People also ask

What is Google CDN jQuery?

Google provides CDN support for jQuery via the googleapis.com domain. The latest version of Google CDN provides four different types of jQuery versions- normal (uncompressed), minified, slim, and slim & minified. Google CDN provides the jQuery via ajax.googleapis.com domain.

What is Ajax Googleapis used for?

The Google AJAX API loader makes it easier to use multiple Google AJAX APIs on the same page and unifies the namespaces across them. Instead of adding a separate script tag for each API, this loader gives you a common way to load multiple APIs at once.

Where do I put jQuery script?

Steve Souders' book High Performance Web Sites recommends putting scripts at the bottom, before the </body> tag.

What is Google hosted libraries?

The Google Hosted Libraries is a stable, reliable, high-speed, globally available content distribution network for the most popular, open-source JavaScript libraries. Google works directly with the key stakeholders for each library effort and accepts the latest versions as they are released.


Video Answer


1 Answers

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.

like image 96
seth Avatar answered Nov 05 '22 11:11

seth