User manual - Scripting_Guide

NAURTECH SMART CLIENTS FOR WINDOWS CE AND POCKET PC
CETerm Scripting Guide Page 41
Example
Several samples for OnBarcodeRead were given in Section 2.5. Following is an
example that checks the RF connection before submitting the data to the host.
This notifies the user that the barcode was not received by the host and instructs
the user to return to RF coverage.
/* OnBarcodeRead */
function OnBarcodeRead( session, data, source, type, date, time )
{
// Check RF status
var status = CETerm.GetProperty( "device.rf.status" );
if (status <= 0)
{
OS.Alert( "No RF signal detected.\n" +
"Barcode discarded.\n" +
"Return to RF coverage." );
// Discard barcode
return 1;
}
// Send barcode to emulator
CETerm.SendText( data, session );
// Return 1 if handled data here
return 1;
}
4.2 THE ONDOCUMENTDONE EVENT
The OnDocumentDone event is fired when a new webpage has completed
loading into a web browser session. The handler can add META tag definitions,
examine or alter the Document Object Model (DOM), or add JavaScript methods
to the page. This event allows CETerm to enhance a web page for mobile data
collection that was not originally designed for such.
Syntax
function OnDocumentDone( session )
session – index of browser session which completed page load.