Programatically get the jQuery version numbers hosted on Google CDN
-
20-12-2019 - |
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.
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