views:

1441

answers:

6

Just wondering if there's a website out there that allows you to hotlink to the latest version of jquery. Does Google code allow you, or does jQuery.com itself?

What I'm not looking for is a site that just happens to have jQuery that I can pinch. I want a site that says that you can hotlink to their jQuery.

+1  A: 

Take a look at this URL.

Pablo Santa Cruz
+13  A: 

Yes.

Everything you need is here: http://code.google.com/apis/libraries/

You can link directly to the javascript file: http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js

or use the google.load method

geoff
The Google code link is broken, Google seems to have moved it to a different URL.
lorin
@lorin - I've updated the link. Thanks.
geoff
+1  A: 

Google hosts jquery for you.

http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery

rohit.arondekar
+4  A: 

You can have google host it in 1 of 2 methods.

Method 1

<script type="text/javascript" 
        src="http://www.google.com/jsapi"&gt;&lt;/script&gt;
<script type="text/javascript">
  // You may specify partial version numbers, such as "1" or "1.3",
  //  with the same result. Doing so will automatically load the 
  //  latest version matching that partial revision pattern 
  //  (i.e. both 1 and 1.3 would load 1.3.2 today).
  google.load("jquery", "1.3.2");

  google.setOnLoadCallback(function() {
    // Place init code here instead of $(document).ready()
  });
</script>

Method 2 (more common)

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;

I know jquery.com host's the file as well for users, they might have redirected there jquery hosting to use the google version though.

jasondavis
+1  A: 

Microsoft is now hosting jQuery as well: http://www.asp.net/ajax/cdn/#4

Lance Fisher
+3  A: 

In addition to JQuery, Google CDN also hosts JQueryUI and all the default Themeroller CSS UI themes (including images!). If you're planning to build a UI from JQuery this is pretty clutch.

http://encosia.com/2009/10/11/do-you-know-about-this-undocumented-google-cdn-feature/

Chinasaur