2 Replies Latest reply on Jul 6, 2012 5:12 AM by mbrouill

    Problem With Custom Toolbar Button Functionality

    mbrouill

      I’m working in RoboHelp 8 webhelp and have created a print button in my skin to print content.  In initial testing it’s worked great. I’ve tried out different inline and external javascript and found success with each method.

       

      One example to create the functionality:

       

      On the Action tab, in the OnClick field enter:

      printAction()

       

      In the inline JavaScript field enter:

      var printAction = function()

      {

      var topicPane = top.frames[1].frames[1];

      topicPane.focus();

      topicPane.print();

      }

       

      When I generate the help and click the print toolbar button, the print dialogue box opens exactly as I want it to.

       

      The problem occurs once I move the help over to a server. I click the button and nothing happens. I see the error on page message display. When opened it reads:

      Line 24
      Char 1
      Error: ‘undefined’ is null or not an object
      Code: 0
      Url:  [My file path]/webhelp/whskin_tbars.htm

       

      Here is the code from that file up until line 26:

       

      <html>

      <head>

      <title> WebHelp Navigation Toolbar </title>

       

      <meta name="generator" content="Adobe RoboHelp 8" />

      <meta name="description" content="WebHelp 5.50" />

      <style>

      <!--

      body {margin:0;}

      -->

      </style>

      <script language="javascript" src="whver.js"></script>

      <script language="javascript1.2" src="whutils.js"></script>

      <script language="javascript1.2" src="whmsg.js"></script>

      <script language="javascript1.2" src="whproxy.js"></script>

      <script language="javascript1.2" src="whmozemu.js"></script>

      <script language="javascript1.2" src="whtbar.js"></script>

       

      <script type="text/javascript" language="JavaScript1.2">

      //<![CDATA[

      var printAction = function()

      {

      var topicPane = top.frames[1].frames[1];

      topicPane.focus();

      topicPane.print();

      }

       

       

      If I'm using different javascript the error line obviously changes. The first time I was testing it (using Willam van Weelden's toolbarscripts01.js in my project) it pointed to line 50 in the whskin_tbars.htm which is: 

      gsIGlossary = "wht_glo_n.gif";

       

      The error occurs in both IE7 and Firefox9.