Epson TM-T20II-i ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 151
ClientConnection Object, send, event, data
View all Epson TM-T20II-i manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 151 highlights
Chapter 5 Device Control Script ClientConnection Object The object passed to the first parameter of the constructor of the device control script. send Sends data to a device object that can run with a browser. Syntax send(event, data); Parameter event data :Object type : (String) Specifies the event name of the device object. :Object type : (Object) Specifies the data to be passed to the event of the device object. Example In the example below, the "onkeypress" event of the device object is called and 49 is obtained form data.keycode and '1' from data.ascii using the "data" parameter of the "onkeypress" event. data = {'keycode' : 49, 'ascii' : '1'}; clientConn.send('onkeypress', data) 5 151
151
Chapter 5
Device Control Script
5
ClientConnection Object
The object passed to the first parameter of the constructor of the device control script.
send
Sends data to a device object that can run with a browser.
Syntax
send
(event, data);
Parameter
event
:Object type : (String)
Specifies the event name of the device object.
data
:Object type : (Object)
Specifies the data to be passed to the event of the device object.
Example
data = {'keycode' : 49, 'ascii' : '1'};
clientConn.send('onkeypress', data)
In the example below, the "onkeypress" event of the device object is called and 49 is obtained
form data.keycode and '1' from data.ascii using the "data" parameter of the "onkeypress" event.