151
Chapter 4 ePOS-Print API
4
onerror event
This property registers the callback function and obtains a communication error event.
Syntax
Function (error)
Parameter of the callback function
Parameters:
error
)
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-3.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 address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer';
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.
Содержание TM-T88V-i
Страница 10: ...10 ...
Страница 14: ...14 ePOS Print Canvas API Monochrome or Grayscale Monochrome ...
Страница 160: ...160 ...
Страница 216: ...216 Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 80mm ...
Страница 218: ...218 Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 80mm ...
Страница 222: ...222 Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 80mm 58mm ...
Страница 258: ...258 ...