Share via


Working with the HTML Help Jscript Applet

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

If you must have compatibility with browsers that don't support ActiveX controls, you can add HTML Help functionality to Web pages by using the HTML Help Jscript applet.

You can use the HTML Help Jscript applet to add the following HTML Help features to HTML pages displayed in your frameset:

  • A table of contents
  • An index
  • Related Topics links

Note that the HTML Help Jscript applet doesn't support displaying text pop-up windows. To create similar functionality, you can use the Jscript alert method of the window object to display a dialog box that contains a text string. For example, the following Jscript displays a simple pop-up message:

<P>This is a <A HREF='JScript:alert("This is a JScript message.")' TITLE="This is a JScript message.">pop-up</A>.</P>

The TITLE attribute of the <A> tag provides a pop-up window for browsers that support this functionality.

To use the HTML Help Jscript applet from an HTML page, insert an <APPLET> tag similar to the one in the following example:

<APPLET CODE=HHCtrl.class
        ALIGN="baseline"
        WIDTH=240
        HEIGHT=270
        NAME=HHCtrl
        ARCHIVE="HHCtrl.zip">

   <PARAM NAME="Cabbase" VALUE="HHCtrl.cab">
   <PARAM NAME="Command" VALUE="Contents">
   <PARAM NAME="Item1" VALUE="hh_toc_java.hhc">
</APPLET>

The CODE attribute specifies HHCtrl.class, which is the name of the Jscript class used to load the HTML Help Jscript applet. Netscape Navigator uses the ARCHIVE attribute to specify a .zip file that contains Jscript class files. In this case, HHCtrl.zip contains all the Jscript class files required by the HTML Help Jscript applet. Similarly, the Cabbase parameter is used by Microsoft Internet Explorer to specify the name of a compressed archive that contains Jscript class files, in this case, in the .cab file format.

The Command parameter is used to specify the kind of HTML Help functionality to be used with this instance of the HTML Help Jscript applet. You can specify the following commands.

Command Description
Contents Specifies that a table of contents will be displayed based on the information supplied in the HTML Help table of contents file specified in the Item1 parameter (normally an .hhc file). The specified file must reside in the same folder as the document containing the applet. You must also include a copy of cntimage.gif to display folder and document icons in the table of contents tree view.
Index Specifies that an index will be displayed based on the information supplied in the HTML Help index file specified in the Item1 parameter (normally an .hhk file). The specified file must reside in the same folder as the document containing the applet.
Related Topics Specifies that a dialog box listing related topics will be displayed based on the information supplied in one or more Itemn parameters in this format:

<PARAM NAME="Itemn" VALUE="TopicTitle;TopicFile.htm">

You can see additional parameters supported by the Contents, Index, and Related Topics commands by opening an HTML file in HTML Help Workshop, and then clicking HTML Help Control on the Tags menu. A wizard that is used to insert the HTML Help ActiveX control appears. You can select the Table of Contents, Index, or Related Topics command from this wizard to insert an <OBJECT> tag for the selected command. Most of the parameters supported by the <OBJECT> tag for the HTML Help ActiveX control can be used with the corresponding command for the HTML Help Jscript applet.

See Also

Using HTML Help to Author a Web Site | Using HTML Help Features from a Custom Frameset | Using a URL to Open a Page in a Compiled HTML Help File