Epson TM-T70-i ePOS-Print API Users Manual For TM-i firmware 4.1 - Page 188
onerror event, Parameter of the callback function, Properties of the error object
View all Epson TM-T70-i manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 188 highlights
onerror event This property registers the callback function and obtains a communication error event. Syntax Function (error) Parameter of the callback function Parameter: Name: Object type: error (See "Properties of the error object" on page 188.) Communication error information Object Properties of the error object property status responseText Name HTTP status Responce text Object type Number String Example To print Canvas(ID=myCanvas): To display the HTTP status code in a message box when a communication error occurs. 188
188
onerror event
This property registers the callback function and obtains a communication error event.
Syntax
Function (error)
Parameter of the callback function
Parameter:
error (
See “Properties of the error object” on page 188.
)
Name:
Communication error information
Object type:
Object
Properties of the error object
Example
property
Name
Object type
status
HTTP status
Number
responseText
Responce text
String
To print Canvas(ID=myCanvas):
To display the HTTP status code in a message box when a communication error occurs.
<script type="text/javascript" src="epos-print-4.x.x.js"></script>
<script type="text/javascript">
<!--
function printCanvas() {
var canvas = document.getElementById('myCanvas');
var epos = new epson.CanvasPrint(address);
epos.onerror = function (err) {
var status = err.status;
var text = err.responseText;
alert(status);
};
epos.print(canvas);
}
//-->
</script>