Using the "external" object on Windows Mobile Platforms

Version 1

    Verified Product Versions

    Wavelink Naurtech CETerm 5.7

    Using the external object in a CETerm script running on a Windows Mobile OS platform device does not seem to work correctly. The same script works correctly on Windows CE OS platform devices.

     

    The "external" is a special variable in JavaScript. It is important to understand the following:

     

    This variable is pre-defined on Windows CE OS platform. It must be defined on Windows Mobile OS platform.

    On Windows Mobile OS platform, when instantiating a new external object through CEBrowseX, you need to do this only one time for the page. Repeat creation of CEBrowseX on the same page should be avoided.

    You cannot make an assignment to "external" on some newer Windows Mobile platforms.

    Here is a sample JavaScript that you can include in your web pages. This will work on either Windows CE or Windows Mobile OS platforms. You can cut and paste this in your web page:

     

    <script language=javascript>

     

        // Resolve ext reference *one* time, when page loads

        var ext = null;  // global variable, not declared in a function

     

        if (typeof external === "object")

        {

            // Windows CE

            // external is already defined in global namespace

            ext = external;

        }

        else

        {

            // Windows Mobile

            // Create CEBrowseX for external access

            ext = new ActiveXObject("Cebrowsex.IdaCtl");

        }

     

        //....

        //......

     

        // Example to use the external object reference in your script or functions

        function MyHandler()

        {

            //TODO: Handler logic

            //.... 

            ext.CETerm.SendIDA("IDA_SESSION_CONNECT", 1);

        }

    </script>