diff options
author | Georg Brandl <georg@python.org> | 2012-10-28 07:06:11 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-10-28 07:06:11 (GMT) |
commit | 819574a226057d8de8ed4b8f92bdd0cf6defb458 (patch) | |
tree | 671c75a7aa8daaa824200c29146f6bbe4a37024b /Doc | |
parent | fd3d102af84bc2ba2162bf5977be91b5e3f9b175 (diff) | |
parent | 55f23c4233b95955a3233284f9f0aa988457a7a7 (diff) | |
download | cpython-819574a226057d8de8ed4b8f92bdd0cf6defb458.zip cpython-819574a226057d8de8ed4b8f92bdd0cf6defb458.tar.gz cpython-819574a226057d8de8ed4b8f92bdd0cf6defb458.tar.bz2 |
merge with 2.6
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/tools/sphinxext/static/version_switch.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Doc/tools/sphinxext/static/version_switch.js b/Doc/tools/sphinxext/static/version_switch.js index 363bebf..cc7be1c 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); |