User manual - Scripting_Guide

NAURTECH SMART CLIENTS FOR WINDOWS CE AND POCKET PC
CETerm Scripting Guide Page 45
/* OnNetCheckFailed */
function
OnNetCheckFailed ( session, pendingURL )
{
// Save pendingURL 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, pendingURL );
// Navigate to static error page
var b = CETerm.Session( session ).Browser;
b.Navigate( "file:///error.htm" );
}
See the OnNavigateError example above for additional details.
4.5 THE ONSESSIONCONNECT EVENT
The OnSessionConnect event is fired when a session initially connects to the
specified host. The handler can be used to initiate an automated login using the
“expect” script and “ExpectMonitor” class.
Syntax
function OnSessionConnect( session )
session – index of session which connected.
Example
An example using OnSessionConnect to start the automated login was shown
above in Section 2.6 and is repeated below. Please refer to Section 2.6 for
details. The “expect” script is discussed in Section 5.1.
/* OnSessionConnect */
function OnSessionConnect( session )
{
// Set login information
var myusername = "joeuser";
var mypassword = "secret";
var waittime = 8000; // Milliseconds waiting for each text
// Only login session 1
if (session == 1)