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() {
9696 return ;
9797 }
9898 var isError = false ;
99- var html = $ . ajax ( {
99+ var notFoundPath = '/web/404.html' ;
100+ var response = $ . ajax ( {
100101 url : mapUrl ,
101102 async : false ,
102103 error : function ( error ) {
103104 alert ( resources . editor . envTips ) ;
104105 isError = true ;
105106 }
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 ;
107115 if ( html && html != "" && ! isError ) {
108116 $ ( '#editor' ) . val ( html ) ;
109117 loadPreview ( html ) ;
110118 } else {
111- window . location . href = window . location . origin + '/web/404.html' ;
119+ window . location . href = window . location . origin + notFoundPath ;
112120 }
113121}
114122
You can’t perform that action at this time.
0 commit comments