Mercurial > hg > webaudioevaluationtool
comparison core.js @ 536:efac13499354 Dev_main
Merge into dev_main
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Mon, 22 Feb 2016 12:19:43 +0000 |
parents | a95d323a911e |
children | 6d652a6c80ed |
comparison
equal
deleted
inserted
replaced
531:26b9c01ad2cc | 536:efac13499354 |
---|---|
340 xmlhttp.onreadystatechange = function() { | 340 xmlhttp.onreadystatechange = function() { |
341 console.log(xmlhttp.status); | 341 console.log(xmlhttp.status); |
342 if (xmlhttp.status != 200 && xmlhttp.readyState == 4) { | 342 if (xmlhttp.status != 200 && xmlhttp.readyState == 4) { |
343 createProjectSave(null); | 343 createProjectSave(null); |
344 } else { | 344 } else { |
345 if (xmlhttp.responseXML == null) | 345 var parser = new DOMParser(); |
346 var xmlDoc = parser.parseFromString(xmlhttp.responseText, "application/xml"); | |
347 if (xmlDoc == null) | |
346 { | 348 { |
347 createProjectSave('null'); | 349 createProjectSave('null'); |
348 } | 350 } |
349 var response = xmlhttp.responseXML.childNodes[0]; | 351 var response = xmlDoc.childNodes[0]; |
350 if (response.getAttribute('state') == "OK") | 352 if (response.getAttribute('state') == "OK") |
351 { | 353 { |
352 var file = response.getElementsByTagName('file')[0]; | 354 var file = response.getElementsByTagName('file')[0]; |
353 console.log('Save OK: Filename '+file.textContent+','+file.getAttribute('bytes')+'B'); | 355 console.log('Save OK: Filename '+file.textContent+','+file.getAttribute('bytes')+'B'); |
354 popup.showPopup(); | 356 popup.showPopup(); |