Epson TM-U220 ePOS-Print XML Users Manual - Page 54
Programming Guide, var res = xhr.responseXML
View all Epson TM-U220 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 54 highlights
Chapter 3 Programming Guide //Set a callback function xhr.onreadystatechange = function () { if (xhr.readyState == 4) { if (xhr.status == 200) { //Obtain the response root element var res = xhr.responseXML; var success = res.getElementsByTagName('response')[0].getAttribute('success'); //When the printing is not successful, display a message if (!/^(1|true)$/.test(success)) { alert('A print error occurred'); } } } // Send print document xhr.send(soap); } 54
54
Chapter 3
Programming Guide
//Set a callback function
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
//Obtain the response root element
var res = xhr.responseXML;
var success = res.getElementsByTagName('response')[0].getAttribute('success');
//When the printing is not successful, display a message
if (!/^(1|true)$/.test(success)) {
alert('A print error occurred');
}
}
}
// Send print document
xhr.send(soap);
}
</script>
</head>
<body>
</body>
</html>