We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f649007 commit 1312193Copy full SHA for 1312193
spec/_static/javascripts/version_dropdown.js
@@ -1,18 +1,14 @@
1
function assign_href( a, url, path ) {
2
- var http = new XMLHttpRequest();
3
- http.open('GET', url + "/" + path );
4
- http.onreadystatechange = function() {
5
- if (this.readyState == this.DONE) {
6
- if(this.status != 404 ){
7
- console.log('%%%%', this);
8
- a.href = url + "/" + path;
9
- }
10
- else {
11
- a.href = url;
12
+ const r = fetch( url + "/" + path );
+ r.then( response => {
+ console.log('...', response);
+ if( response.ok ){
+ a.href = url + "/" + path;
13
}
14
- };
15
- http.send();
+ else {
+ a.href = url;
+ }
+ });
16
17
18
function add_version_dropdown(json_loc, target_loc, text) {
0 commit comments