Example for windows mobile devices – Casio Naurtech CETerm Ver.5.5 Scripting Guide User Manual

Page 88

Advertising
background image

N

AURTECH

W

EB

B

ROWSER AND

T

ERMINAL

E

MULATION FOR

W

INDOWS

CE

AND

W

INDOWS

M

OBILE




CETerm Scripting Guide

Page 88


// 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 discarded 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.

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;


Advertising
This manual is related to the following products: