Casio Naurtech CETerm Ver.5.5 Scripting Guide Manuale Utente Pagina 89

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 164
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 88
NAURTECH WEB BROWSER AND TERMINAL EMULATION FOR WINDOWS CE AND WINDOWS MOBILE
CETerm Scripting Guide Page 89
4.6 THE ONNAVIGATEREQUEST EVENT
The OnNavigateRequest event is fired before the browser begins a navigation.
Normally, all navigation control should be done within the HTML of a page. In
rare cases when the pages cannot be modified, this handler can be used to
control navigations. This handler can cancel a navigation or request an
alternative navigation.
Syntax
function OnNavigateRequest ( session, url )
session index of browser session.
url target URL of navigation request.
The return value of OnNavigateRequest is used to control the navigation. A
return value of 0 will allow the navigation to continue, a value greater than 0 will
cancel the navigation.
Example
This example shows how to control navigation.
/* OnNavigateRequest */
function OnNavigateRequest( session, url )
{
// Prevent unwanted URL
if (url.match( "forbidden.htm" )) return 1;
// Require password
if (url.match( "protected.htm" ))
{
var t = CETerm.TextInput;
t.Title = "Administrator Login";
t.Prompt = "Please enter your password:";
t.PasswordMode = true;
t.Input = ""; // Clear current password
var s = t.GetInput();
if (s !== 1 || t.Input !== "secret")
{
// Bad password, cancel
return 1;
}
t.Input = ""; // Clear password
}
Vedere la pagina 88
1 2 ... 84 85 86 87 88 89 90 91 92 93 94 ... 163 164

Commenti su questo manuale

Nessun commento