]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#8040: fix jQuery incompatibility
authorGeorg Brandl <georg@python.org>
Sun, 28 Oct 2012 06:59:42 +0000 (07:59 +0100)
committerGeorg Brandl <georg@python.org>
Sun, 28 Oct 2012 06:59:42 +0000 (07:59 +0100)
Doc/tools/sphinxext/static/version_switch.js

index 363bebfcd8a8bdb73d57608300eee3c0d3c189a9..cc7be1c539d22668eccdff37894417b28ba899cf 100644 (file)
 
     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);