diff options
| author | Brett Cannon <brett@python.org> | 2012-10-28 15:48:24 (GMT) |
|---|---|---|
| committer | Brett Cannon <brett@python.org> | 2012-10-28 15:48:24 (GMT) |
| commit | 0e8c49d3583bbe86dd26f07819fd526eda8a0dcc (patch) | |
| tree | cd085f2d606c69f7569e5006b6fa98faf7001197 /Doc/tools/sphinxext/static/version_switch.js | |
| parent | 6a85f3cbe4b43860c527c43bd5da0220c4f96c0e (diff) | |
| parent | 8ca705d5495f02ad93380e1f960adb98f7c00e22 (diff) | |
| download | cpython-0e8c49d3583bbe86dd26f07819fd526eda8a0dcc.zip cpython-0e8c49d3583bbe86dd26f07819fd526eda8a0dcc.tar.gz cpython-0e8c49d3583bbe86dd26f07819fd526eda8a0dcc.tar.bz2 | |
merge
Diffstat (limited to 'Doc/tools/sphinxext/static/version_switch.js')
| -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); |
