Permalink
Browse files

Fix jQuery loader to use path of itself. Fixes nested demos.

  • Loading branch information...
1 parent af2b388 commit 52b2d8115649111e51317c4a79c7b306197a844b @jzaefferer jzaefferer committed Mar 2, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/jquery.js
View
@@ -2,6 +2,8 @@
var parts = document.location.search.slice( 1 ).split( "&" ),
length = parts.length,
+ scripts = document.getElementsByTagName("script"),
+ src = scripts[ scripts.length - 1].src,
i = 0,
current,
version = "1.9.0",
@@ -16,7 +18,7 @@ for ( ; i < length; i++ ) {
}
if (version != "git") {
- file = "../lib/jquery-" + version + ".js";
+ file = src.replace(/jquery\.js$/, "jquery-" + version + ".js");
}

0 comments on commit 52b2d81

Please sign in to comment.