Google Libraries - URL version selecting
Read开发者_如何学运维ing through documentation,
I found following:
1.9.1
1.8.4
1.8.2
A version of "1.8.2" select the obvious, fully-specified version. Specifying a version of "1.8" would select 1.8.4 since this is the highest version released in the 1.8 branch. For much the same reason, a request for "1" loads version 1.9.1, since this is the highest version released in the 1 branch. Note, these versioning semantics work the same way when using google.load and when using direct script urls.
Does that mean, that I can use something like
http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
and I get latest jQuery v1.** ?
Or, would it be even possible to include:
http://ajax.googleapis.com/ajax/libs/jquery/jquery.min.js
Well, just testing the two URL you gave :
http://ajax.googleapis.com/ajax/libs/jquery/jquery.min.js
This doesn't work : I get a 404 error.
So, it seems you must specify at least the major version number (i.e. the first digit in 1.4.2) -- which seems reasonable, as a change in major version number generally means a big change in the API (which will probably require you to change stuff in your application).
And with the first one :
http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
I get jQuery 1.4.2 -- which is indeed the most recent version.
And if I test with prototype :
http://ajax.googleapis.com/ajax/libs/prototype/1/prototype.js
I get the most recent version too.
精彩评论