Show/Hide Toolbars

Managing an FVTerm Child iFrame in Javascript

Navigation: » No topics above this level «

Direct Parent HTML Sample (direct non-messaging only)

Scroll Prev Top Next More

This sample is now distributed with the FVTerm folder and can be found as "FVParent.html".  It utilizes the  FVTermParent.js script file found in the FVTerm/Scripts folder.

 

The sample demonstrates hosting an FVTerm iFrame and integrating using the FVTermParent.js which contains a Javascript class that connects to the FVTerm frame and provides hookable events.

 

<!DOCTYPE html">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head>

  <title>Inventu Viewer+ Emulator Host Page Demonstration</title>

 <script language="javascript" type="text/javascript" src="Scripts/FVTermParent.js"></script>

 <script type="text/javascript">

         var fvt = null, sessKey = null,

 

         function StartFVTerm()

         {

                 ConnectFVTerm('FVTerm', '/FVTerm/SCTerm.html', {"autoStart":true,"hostName":"Insure"},

                         function (fvApi, sessionKey)

                         {

                                 if (fvApi)

                                 {

                                         fvt = fvApi;

                                         sessKey = sessionKey;

                                         fvt.onnewscreen = onNewScreen;

                                 }

                                 else

                                 {

                                         alert(sessionKey); // If the fvApi object is null the connect failed and sessionKey is the error

                                 }

                         });

         }

         

         function onNewScreen(rows, name)

         {

                 // Run a logon macro anytime the signon screen appears

                 if ((rows[5].substr(16, 4) == 'User') &&

                          (rows[6].substr(16, 8) == 'Password'))

                         fvt.StartMacro('OrderSearch', true);

         }

 </script>

</head>

<body onload="StartFVTerm()">

<iframe id="FVTerm" style="position:absolute;left:0px;top:0px;width:100%;height:100%" frameborder="0" src="about:blank"></iframe>

</body>

</html>