Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Default to 1.7.1

Pick up local for 1.6.4, 1.7.1, 1.7.2
CDN versions for the rest
  • Loading branch information...
commit 690744455c09727994fdbfd0f7dc0161adc1fa41 1 parent 3a0bb96
@gseguin gseguin authored
Showing with 7 additions and 9 deletions.
  1. +7 −9 js/jquery.tag.inserter.js
View
16 js/jquery.tag.inserter.js
@@ -4,25 +4,23 @@
// Get the version from the url
var jqueryRE = /[\\?&]jquery=([^&#]*)/,
results = jqueryRE.exec( location.search ),
- version = "",
- jq,
+ version = "1.7.1",
myScriptTag = document.getElementsByTagName( "script" )[document.getElementsByTagName( "script" ).length - 1],
baseUrl = myScriptTag.src.replace( /(.*)\/.*$/, "$1/" ),
- url = baseUrl + "jquery-1.7.1.js";
+ url;
if( results ) {
version = decodeURIComponent(results[results.length - 1].replace(/\+/g, " "));
- } else {
- version = "1.6.4";
- }
+ }
switch( version ) {
+ // Local versions
case "1.6.4":
- url = baseUrl + "jquery-1.6.4.js";
- break;
+ case "1.7.1":
case "1.7.2":
- url = baseUrl + "jquery-1.7.2.js";
+ url = baseUrl + "jquery-" + version + ".js";
break;
+ // CDN versions
default:
url = "http://code.jquery.com/jquery-"+version+".js";
break;
Please sign in to comment.
Something went wrong with that request. Please try again.