Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Is there a link to the “latest” jQuery library on Google APIs?

I utilise the following for a jQuery link in my <script> tags:
ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js


Is there a link to the "latest" version? Something like the following
 ajax.googleapis.com/ajax/libs/jquery/latest/jquery.js
by

3 Answers

akshay1995
Use:

<script type="text/javascript" src="//www.google.com/jsapi"></script>
<script type="text/javascript">
//<![CDATA[
google.load("jquery", "1");
//google.load("jqueryui", "1");
//google.load("swfobject", "1");
//]]>
</script>

Note: The above snippet will stick to 1.7.1 or 1.11.1.

My advice for production is to hard code the CDN jQuery version: <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
akshay1995
Use:

<script type="text/javascript" src="//www.google.com/jsapi"></script>
<script type="text/javascript">
//<![CDATA[
google.load("jquery", "1");
//google.load("jqueryui", "1");
//google.load("swfobject", "1");
//]]>
</script>

Note: The above snippet will stick to 1.7.1 or 1.11.1.

My advice for production is to hard code the CDN jQuery version: <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
pankajshivnani123
Not for nothing, but you shouldn't just automatically use the latest library. If they release the newest library tomorrow and it breaks some of your scripts, you are SOL, but if you use the library you used to develop the scripts, you will ensure they will work.

Login / Signup to Answer the Question.