OnStateChanged Event



 
Fires when the plugin State Property changes.


Syntax

    SiteKiosk.Plugins("SitePhone").OnStateChanged = handler
Remarks
    The object that caused the event can be referenced in the event function using "this".
Examples
    The following example logs the SitePhone state.

    <SCRIPT TYPE="text/javascript">
    window.external.InitScriptInterface();
    SitePhone = SiteKiosk.Plugins("SitePhone");
    SitePhone.OnStateChanged = OnStateChanged;
    
    var S_OFFLINE = 0;
    var S_CONNECTING = 1;
    var S_PAUSING = 2;
    var S_ONLINE = 3;
    
    function OnStateChanged()
    {
       switch (SitePhone.State)
       {
          case S_OFFLINE:
             SiteKiosk.Logfile.Notification("SitePhone is now offline.");
             break;
          case S_CONNECTING:
             SiteKiosk.Logfile.Notification("SitePhone is now connecting.");
             break;
          case S_PAUSING:
             SiteKiosk.Logfile.Notification("SitePhone is now pausing.");
             break;
          case S_ONLINE:
             SiteKiosk.Logfile.Notification("SitePhone is now online.");
             break;
          default:
             SiteKiosk.Logfile.Notification("SitePhone state is unknown.");
       }
    }
    </SCRIPT>
    

Applies to
    SiteKiosk v7.0 (and later versions).

Back to top