11 Replies Latest reply on Aug 8, 2011 12:49 PM by Willam van Weelden

    Javascript for showing/printing dropdown/expanding text - not working in FF

    TorgeirH Level 1

      Hi


      (using RH 8.0.2, building chm/webhelp, displaying webhelp in FF 3.6+)

      I've got a clickable text ("Click here to print the topic") in my topic footers which displays dropdowns and expanding texts and opens the print dialog. Works well in IE, but in Firefox nothing happens. Using a Web developer tool to find the error, I get the error message "arrayofDivs is undefined" for the highlighted line in the script below.

       

      I have borrowed the script from the Robohelp experts in this forum, and have no javascript skills, so I'm looking for any clue on how to fix this script for Firefox. Any help is greatly appreciated!

       

      The script:

      <script type="text/javascript" language="JavaScript1.2">//<![CDATA[
      <!--
      var arrayofDivs = document.all.tags("DIV");

       

      function showEm() { for (x=0;x<arrayofDivs.length;x++) { arrayofDivs[x].style.display = "block"; }
      }

      function hideEm() { for (x=0;x<arrayofDivs.length;x++) { arrayofDivs[x].style.display = "none"; }
      }
      function printEm() { ;showEm();setTimeout('window.print()',50)}
      //-->
      //]]></script>

       

       

      The link:

      <p align="center"><a href="chap01\#" onclick="JavaScript:printEm()">Click here to print the topic</a></p>

       

       

      Best regards,

       

      Torgeir