Mercurial > hg > webaudioevaluationtool
comparison core.js @ 2018:301acd614289
Better error catching when using server save to determine if the 'Save File' should be shown in browser.
author | Nicholas Jillings <nickjillings@users.noreply.github.com> |
---|---|
date | Mon, 01 Jun 2015 17:00:45 +0100 |
parents | 302ae8a6ca53 |
children | 3a77fed8a32c |
comparison
equal
deleted
inserted
replaced
2017:4a14c8a65af2 | 2018:301acd614289 |
---|---|
376 xmlhttp.setRequestHeader('Content-Type', 'text/xml'); | 376 xmlhttp.setRequestHeader('Content-Type', 'text/xml'); |
377 xmlhttp.onerror = function(){ | 377 xmlhttp.onerror = function(){ |
378 console.log('Error saving file to server! Presenting download locally'); | 378 console.log('Error saving file to server! Presenting download locally'); |
379 createProjectSave(null); | 379 createProjectSave(null); |
380 }; | 380 }; |
381 xmlhttp.onreadystatechange = function() { | |
382 console.log(xmlhttp.status); | |
383 if (xmlhttp.status != 200 && xmlhttp.readyState == 4) { | |
384 createProjectSave(null); | |
385 } | |
386 }; | |
381 xmlhttp.send(file); | 387 xmlhttp.send(file); |
382 if (xmlhttp.status == 404) { | |
383 createProjectSave(null); | |
384 } | |
385 } | 388 } |
386 return submitDiv; | 389 return submitDiv; |
387 } | 390 } |
388 | 391 |
389 // Only other global function which must be defined in the interface class. Determines how to create the XML document. | 392 // Only other global function which must be defined in the interface class. Determines how to create the XML document. |