#8040: fix jQuery incompatibility

This commit is contained in:
Georg Brandl 2012-10-28 07:59:42 +01:00
parent c3bf78a212
commit fffc25da83
1 changed files with 10 additions and 8 deletions

View File

@ -43,19 +43,21 @@
if (new_url != url) { if (new_url != url) {
// check beforehand if url exists, else redirect to version's start page // check beforehand if url exists, else redirect to version's start page
$.get(new_url, function() { $.ajax({
window.location.href = new_url; url: new_url,
}).error(function() { success: function() {
window.location.href = 'http://docs.python.org/' + selected; window.location.href = new_url;
},
error: function() {
window.location.href = 'http://docs.python.org/' + selected;
}
}); });
} }
} }
$(document).ready(function() { $(document).ready(function() {
var version = DOCUMENTATION_OPTIONS.VERSION.split('.'), var release = DOCUMENTATION_OPTIONS.VERSION;
release = DOCUMENTATION_OPTIONS.RELEASE || DOCUMENTATION_OPTIONS.VERSION; var version = release.substr(0, 3);
version = version[0] + '.' + version[1];
var select = build_select(version, release); var select = build_select(version, release);
$('.version_switcher_placeholder').html(select); $('.version_switcher_placeholder').html(select);