5 the onnavigateerror event, Syntax, Example for windows ce 5.0 devices – Casio Naurtech CETerm Ver.5.5 Scripting Guide User Manual
Page 87

N
AURTECH
W
EB
B
ROWSER AND
T
ERMINAL
E
MULATION FOR
W
INDOWS
CE
AND
W
INDOWS
M
OBILE
CETerm Scripting Guide
Page 87
else
{
if (PreviousKeyboardState[session] ===
IBM_KEYBOARD_NORMAL_UNLOCKED)
{
CETerm.PostIDA( "IDA_SCAN_SUSPEND", 0 );
}
}
// Save new state
PreviousKeyboardState[session] = state;
}
4.5
T
HE
O
N
N
AVIGATE
E
RROR
E
VENT
The OnNavigateError event is fired if the browser fails to complete a
navigation. Typically, the error handler will redirect the web browser to a
“file:”
URL on the device for error recovery. This event may fire if the device loses RF
coverage during a navigation or the web server crashes. It is a good practice to
use the CETerm “Check Network Before Send” feature to validate RF coverage
prior to submitting the navigation request and use the OnNavigateError for
additional error handling.
Syntax
function OnNavigateError ( session, params )
session
– index of browser session which failed to navigate.
params
– navigation error parameters, including the error number and URL.
The params argument is formatted as URL parameters and has the form:
error=0x800C0005&url=http://192.168.1.20/application.exe?state=3&scan=0
Everything after url= in the params argument is the URL that failed to
navigate, along with all the parameters of that URL. The error values are
standard Microsoft browser status codes and are defined in Appendix 4.
Example for Windows CE 5.0 devices
This example shows how to redirect a web browser to a static URL on the
device.
/* OnNavigateError */
function OnNavigateError ( session, params )
{