User manual - Scripting_Guide

NAURTECH SMART CLIENTS FOR WINDOWS CE AND POCKET PC
CETerm Scripting Guide Page 44
Example For Windows Mobile devices
Handheld devices using Windows Mobile can use a different technique to pass
on the params URL. For these devices, the parameters of a “file:” URL are
available within the browser. The error parameters can simply be passed on to
the static page without using a “User Text x” variable.
/* OnNavigateError */
function OnNavigateError( session, params )
{
// Navigate to static error page
var b = CETerm.Session( session ).Browser;
b.Navigate( "file:///error.htm?" + params );
}
The error page can access the failed URL parameters using normal techniques
to re-attempt the navigation or decide on other error recovery.
var params = document.location.search;
4.4 THE ONNETCHECKFAILED EVENT
The OnNetCheckFailed event is fired if a “Network Check on Send” fails to
detect the host system and the Network Check Action is
“ida://IDA_SCRIPT_ON_NETCHECKFAILED”. Other Network Check Actions
are possible, including direct naming of an error URL. See the User Manual for
more information. Typically, this error handler will redirect the web browser to a
“file:” URL on the device for error recovery.
Syntax
function OnNetCheckFailed( session, pendingURL )
session – index of browser session attempting navigation.
pendingURL – pending URL for navigation.
The pendingURL is the destination that the user requested but which has been
deferred because the host was not contacted. The event handler can re-try the
navigation.
Example
This example is nearly identical to the OnNavigateError handler except that
there is no error number in the pendingURL. This handler
shows how to redirect a Windows CE web browser to a static URL on the device.