Mercurial > hg > webaudioevaluationtool
comparison core.js @ 1971:e62289760587
Bug #1349: PHP returns XML confirmation or error and message. Core responds. Bug #1449 not a bug
author | Nicholas Jillings <nickjillings@users.noreply.github.com> |
---|---|
date | Fri, 20 Nov 2015 15:39:01 +0000 |
parents | cf08f2881a39 |
children | 235594325b84 |
comparison
equal
deleted
inserted
replaced
1970:cf08f2881a39 | 1971:e62289760587 |
---|---|
672 xmlhttp.onreadystatechange = function() { | 672 xmlhttp.onreadystatechange = function() { |
673 console.log(xmlhttp.status); | 673 console.log(xmlhttp.status); |
674 if (xmlhttp.status != 200 && xmlhttp.readyState == 4) { | 674 if (xmlhttp.status != 200 && xmlhttp.readyState == 4) { |
675 createProjectSave(null); | 675 createProjectSave(null); |
676 } else { | 676 } else { |
677 popup.showPopup(); | 677 if (xmlhttp.responseXML == null) |
678 popup.popupContent.innerHTML = null; | 678 { |
679 popup.popupContent.textContent = "Thank you!"; | 679 return createProjectSave(null); |
680 } | |
681 var response = xmlhttp.responseXML.childNodes[0]; | |
682 if (response.getAttribute('state') == "OK") | |
683 { | |
684 var file = response.getElementsByTagName('file')[0]; | |
685 console.log('Save OK: Filename '+file.textContent+','+file.getAttribute('bytes')+'B'); | |
686 popup.showPopup(); | |
687 popup.popupContent.innerHTML = null; | |
688 popup.popupContent.textContent = "Thank you!"; | |
689 } else { | |
690 var message = response.getElementsByTagName('message')[0]; | |
691 errorSessionDump(message.textContent); | |
692 } | |
680 } | 693 } |
681 }; | 694 }; |
682 xmlhttp.send(file); | 695 xmlhttp.send(file); |
683 } | 696 } |
684 } | 697 } |