Mercurial > hg > webaudioevaluationtool
comparison js/core.js @ 2548:67cf18d08af8
Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool
author | www-data <www-data@sucuk.dcs.qmul.ac.uk> |
---|---|
date | Thu, 17 Nov 2016 13:20:56 +0000 |
parents | bee11d64db84 |
children | c40cda1c2839 fff464febd56 |
comparison
equal
deleted
inserted
replaced
2545:62d61c7799fb | 2548:67cf18d08af8 |
---|---|
486 console.log("WARNING - Could not update at this time"); | 486 console.log("WARNING - Could not update at this time"); |
487 createProjectSave("local"); | 487 createProjectSave("local"); |
488 } else { | 488 } else { |
489 var parser = new DOMParser(); | 489 var parser = new DOMParser(); |
490 var xmlDoc = parser.parseFromString(xmlhttp.responseText, "application/xml"); | 490 var xmlDoc = parser.parseFromString(xmlhttp.responseText, "application/xml"); |
491 var response = xmlDoc.getElementsByTagName('response')[0]; | 491 var response = xmlDoc.firstElementChild; |
492 if (response.getAttribute("state") == "OK") { | 492 if (response.nodeName == "response" && response.getAttribute("state") == "OK") { |
493 window.onbeforeunload = undefined; | 493 window.onbeforeunload = undefined; |
494 var file = response.getElementsByTagName("file")[0]; | 494 var file = response.getElementsByTagName("file")[0]; |
495 console.log("Save: OK, written " + file.getAttribute("bytes") + "B"); | 495 console.log("Save: OK, written " + file.getAttribute("bytes") + "B"); |
496 if (typeof specification.returnURL == "string" && specification.returnURL.length > 0) { | 496 if (typeof specification.returnURL == "string" && specification.returnURL.length > 0) { |
497 window.location = specification.returnURL; | 497 window.location = specification.returnURL; |