From: Georg Brandl Date: Sun, 28 Oct 2012 06:59:42 +0000 (+0100) Subject: #8040: fix jQuery incompatibility X-Git-Tag: v3.2.4rc1~403 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fffc25da8388b4bcea4c81e1b3dff4e4f4e85b0a;p=thirdparty%2FPython%2Fcpython.git #8040: fix jQuery incompatibility --- diff --git a/Doc/tools/sphinxext/static/version_switch.js b/Doc/tools/sphinxext/static/version_switch.js index 363bebfcd8a8..cc7be1c539d2 100644 --- a/Doc/tools/sphinxext/static/version_switch.js +++ b/Doc/tools/sphinxext/static/version_switch.js @@ -43,19 +43,21 @@ if (new_url != url) { // check beforehand if url exists, else redirect to version's start page - $.get(new_url, function() { - window.location.href = new_url; - }).error(function() { - window.location.href = 'http://docs.python.org/' + selected; + $.ajax({ + url: new_url, + success: function() { + window.location.href = new_url; + }, + error: function() { + window.location.href = 'http://docs.python.org/' + selected; + } }); } } $(document).ready(function() { - var version = DOCUMENTATION_OPTIONS.VERSION.split('.'), - release = DOCUMENTATION_OPTIONS.RELEASE || DOCUMENTATION_OPTIONS.VERSION; - - version = version[0] + '.' + version[1]; + var release = DOCUMENTATION_OPTIONS.VERSION; + var version = release.substr(0, 3); var select = build_select(version, release); $('.version_switcher_placeholder').html(select);