Mercurial > hg > webaudioevaluationtool
comparison core.js @ 1012:4df1b4e7596f
Better error catching when using server save to determine if the 'Save File' should be shown in browser.
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Mon, 01 Jun 2015 17:00:45 +0100 |
parents | 98a5db2ae8a1 |
children | 3a77fed8a32c |
comparison
equal
deleted
inserted
replaced
1011:2df5ba8845b3 | 1012:4df1b4e7596f |
---|---|
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. |