Dispatch Object



 
The Dispatch object represents the members defined in the SiteCash script file.


Syntax

    [obj=] SiteKiosk.Plugins("SiteCash").Script.Dispatch
    
Remarks
    This object is available through the object Script. Use the Dispatch object to use objects, properties and methods defined in the SiteCash script file.

    Note that the path of a file using SiteKiosk objects must be allowed in the
    SiteKiosk configuration (Security -> Access -> URL's With Script Permission)
    if it is not a browser skin file.
Examples
    SiteCash script file:

    var mystring = "SiteKiosk";
    
    function change_mystring()
    {
       mystring = "PROVISIO";
    }
    


    The following example shows how to use members of the SiteCash script file notated above.

    <SCRIPT TYPE="text/javascript">
    window.external.InitScriptInterface();
    alert(SiteKiosk.Plugins("SiteCash").Script.Dispatch.mystring);
    SiteKiosk.Plugins("SiteCash").Script.Dispatch.change_mystring();
    alert(SiteKiosk.Plugins("SiteCash").Script.Dispatch.mystring);
    </SCRIPT>
    


    The next example shows the so-called pull mode, which allows you to set up charges on a Web site by using a script.
    This function lets you generate additional revenues on top of the turnover you achieve by charging rates on a per-minute basis by allowing you to charge one-time charges for certain services/Web sites. You can use this function to create your own list of services for which you want to charge one-time charges. For instance, some customers have used this function to charge their customers using SiteKiosk for making phone calls.
    In this example the Web site google.com will be opened provided a money value of 0.5 is deposited within 30 seconds. Since the function StartPullRequest is implemented in the file Sitekiosk\SiteCash\SiteCashScript.js, you can change and adjust it to fit your needs.

    <SCRIPT TYPE="text/javascript">
    window.external.InitScriptInterface();
    
    function OnPullRequestCompleted(success)
    {
    	if (success) 
    		window.location.href="http://www.google.com/";
    }
    
    Disp = SiteKiosk.Plugins("SiteCash").Script.Dispatch;
    Disp.StartPullRequest("Navigation", 0.5, OnPullRequestCompleted, 30);
    </SCRIPT>
    

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

Back to top