File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -2591,12 +2591,23 @@ const EasyCoder_Browser = {
2591
2591
}
2592
2592
}
2593
2593
} ;
2594
+ ajax . onerror = function ( data ) {
2595
+ if ( command . onError ) {
2596
+ program . errorMessage = this . responseText ;
2597
+ program . run ( command . onError ) ;
2598
+ } else {
2599
+ const error = this . responseText ;
2600
+ program . runtimeError ( command . lino , error ) ;
2601
+ }
2602
+ } ;
2594
2603
program . ajaxCommand = command ;
2595
2604
const rest = document . getElementById ( `easycoder-rest` ) ;
2596
2605
if ( ! rest ) {
2597
2606
program . runtimeError ( command . lino , `No REST server defined` ) ;
2598
2607
}
2599
- const postpath = path . startsWith ( `http` ) ? path : `${ window . location . origin } ${ rest } /${ path } ` ;
2608
+ const postpath = path . startsWith ( `http` )
2609
+ ? path
2610
+ : `${ window . location . origin } /${ rest . innerText } /${ path } ` ;
2600
2611
ajax . open ( `POST` , postpath ) ;
2601
2612
ajax . send ( formData ) ;
2602
2613
}
You can’t perform that action at this time.
0 commit comments