Show/Hide Toolbars

Managing an FVTerm Child iFrame in Javascript

Navigation: » No topics above this level «

Messaging Parent HTML Sample

Scroll Prev Top Next More

The sample demonstrates hosting an FVTerm iFrame and integrating using the FVTermMsgApi.js module, 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/FVTermMsgApi.js"></script>

 <script type="text/javascript">

         var fvApi = null, sessKey = null,

 

         function StartFVTerm()

         {

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

                         function (fvApiNew, sessionKey)

                         {

                                 if (fvApiNew)

                                 {

                                         fvApi = fvApiNew;

                                         sessKey = sessionKey;

                                         fvApi.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'))

                         fvApi.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>