User manual - Scripting_Guide

NAURTECH SMART CLIENTS FOR WINDOWS CE AND POCKET PC
CETerm Scripting Guide Page 43
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 )
{
// Save params in text 3x where x is session index
// This is required by CE 5.0 devices which do not pass
// parameters to a "file:" URL.
CETerm.SetProperty( "app.usertext.3" + session, params );
// Navigate to static error page
var b = CETerm.Session( session ).Browser;
b.Navigate( "file:///error.htm" );
}
Note the CETerm.SetProperty() call. This method saves the params in
persistent memory for later use by the "error.htm" web page. The reason to do
this is because the parameters are lost by the Windows CE browser when
navigating to a "file:" resource. The error web page can retrieve the params
using:
var property = "app.usertext.3" + external.sessionindex;
var params = external.CETerm.GetProperty( property );
Using the URL, the error page can re-attempt the navigation or decide on other
error recovery. Please note that the "User Text x" is used for several purposes in
CETerm, including key remapping. Be sure that this use does not collide with
other uses in your configuration.