Question

Is there a service that will return the version numbers of jQuery that are hosted on Google? They are posted on their webpage, but is there a way to get that data without parsing the page text?

I want to automatically link to the latest 1.x release when scaffolding a new project (not link to the latest version on production sites).

Thanks.

Était-ce utile?

La solution

Yes, you can simply link to the "1.x" family:

http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js

...and parse out the version from the beginning of that file:

/*! jQuery v1.11.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top