File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -96,19 +96,27 @@ function loadExampleHtml() {
96
96
return ;
97
97
}
98
98
var isError = false ;
99
- var html = $ . ajax ( {
99
+ var notFoundPath = '/web/404.html' ;
100
+ var response = $ . ajax ( {
100
101
url : mapUrl ,
101
102
async : false ,
102
103
error : function ( error ) {
103
104
alert ( resources . editor . envTips ) ;
104
105
isError = true ;
105
106
}
106
- } ) . responseText ;
107
+ } ) ;
108
+ if ( response && response . status === 302 ) {
109
+ var location = response . getResponseHeader ( 'Location' ) ;
110
+ if ( location && location . indexOf ( notFoundPath ) !== - 1 ) {
111
+ isError = true ;
112
+ }
113
+ }
114
+ var html = response . responseText ;
107
115
if ( html && html != "" && ! isError ) {
108
116
$ ( '#editor' ) . val ( html ) ;
109
117
loadPreview ( html ) ;
110
118
} else {
111
- window . location . href = window . location . origin + '/web/404.html' ;
119
+ window . location . href = window . location . origin + notFoundPath ;
112
120
}
113
121
}
114
122
You can’t perform that action at this time.
0 commit comments