提交 | 用户 | 时间
|
58d006
|
1 |
(function() { |
A |
2 |
|
|
3 |
var parts = document.location.search.slice( 1 ).split( "&" ), |
|
4 |
length = parts.length, |
|
5 |
scripts = document.getElementsByTagName("script"), |
|
6 |
src = scripts[ scripts.length - 1].src, |
|
7 |
i = 0, |
|
8 |
current, |
|
9 |
version = "1.9.0", |
|
10 |
file = "http://code.jquery.com/jquery-git.js"; |
|
11 |
|
|
12 |
for ( ; i < length; i++ ) { |
|
13 |
current = parts[ i ].split( "=" ); |
|
14 |
if ( current[ 0 ] === "jquery" ) { |
|
15 |
version = current[ 1 ]; |
|
16 |
break; |
|
17 |
} |
|
18 |
} |
|
19 |
|
|
20 |
if (version != "git") { |
|
21 |
file = src.replace(/jquery\.js$/, "jquery-" + version + ".js"); |
|
22 |
} |
|
23 |
|
|
24 |
|
|
25 |
document.write( "<script src='" + file + "'></script>" ); |
|
26 |
|
|
27 |
})(); |