Epson TM-T70-i ePOS-Print API Users Manual For TM-i firmware 4.1 - Page 148
onerror event, Function error
![]() |
View all Epson TM-T70-i manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 148 highlights
onerror event This property registers the callback function and obtains a communication error event. Syntax Function (error) Parameter of the callback function Parameters: Name: Object type: error (See "Properties of the error object" on page 148.) Communication error information Object Properties of the error object Property status responseText Name HTTP Status Response text Object type Number String Example To create and send a print document. To display the HTTP status code in a message box when a communication error occurs. 148
![](/manual_guide/products/epson-p60ii-eposprint-api-user-s-manual-tmi-firmware-41-a0c01f3/148.png)
148
onerror event
This property registers the callback function and obtains a communication error event.
Syntax
Function (error)
Parameter of the callback function
Parameters:
error (
See “Properties of the error object” on page 148.
)
Name:
Communication error information
Object type:
Object
Properties of the error object
Example
Property
Name
Object type
status
HTTP Status
Number
responseText
Response text
String
<script type="text/javascript" src=”epos-print-4.x.x.js"></script>
<script type="text/javascript">
<!--
function printHellowWorld() {
var builder = new epson.ePOSBuilder();
builder.addText('Hello, World!\n');
builder.addCut();
var request = builder.toString();
var epos = new epson.ePOSPrint(address);
epos.onerror = function (err) {
var status = err.status;
var text = err.responseText;
alert(status);
}
epos.send(request);
}
//-->
</script>
To create and send a print document.
To display the HTTP status code in a message box when a communication error occurs.