Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a version of jQuery somewhere that I can hotlink to without hosting the file?

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.

like image 740
Eric Avatar asked Sep 05 '09 14:09

Eric


2 Answers

Yes, it's available on Google's CDN.

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

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

or use the google.load method


Update

Its also available on Microsoft's CDN or the jQuery CDN

like image 106
Geoff Appleford Avatar answered Oct 12 '22 15:10

Geoff Appleford


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

Method 1

<script type="text/javascript" 
        src="http://www.google.com/jsapi"></script>
<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"></script>

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.

like image 10
JasonDavis Avatar answered Oct 12 '22 15:10

JasonDavis