Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fffc25d

Browse files
committed
#8040: fix jQuery incompatibility
1 parent c3bf78a commit fffc25d

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

Doc/tools/sphinxext/static/version_switch.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,21 @@
4343

4444
if (new_url != url) {
4545
// check beforehand if url exists, else redirect to version's start page
46-
$.get(new_url, function() {
47-
window.location.href = new_url;
48-
}).error(function() {
49-
window.location.href = 'http://docs.python.org/' + selected;
46+
$.ajax({
47+
url: new_url,
48+
success: function() {
49+
window.location.href = new_url;
50+
},
51+
error: function() {
52+
window.location.href = 'http://docs.python.org/' + selected;
53+
}
5054
});
5155
}
5256
}
5357

5458
$(document).ready(function() {
55-
var version = DOCUMENTATION_OPTIONS.VERSION.split('.'),
56-
release = DOCUMENTATION_OPTIONS.RELEASE || DOCUMENTATION_OPTIONS.VERSION;
57-
58-
version = version[0] + '.' + version[1];
59+
var release = DOCUMENTATION_OPTIONS.VERSION;
60+
var version = release.substr(0, 3);
5961
var select = build_select(version, release);
6062

6163
$('.version_switcher_placeholder').html(select);

0 commit comments

Comments
 (0)