Click to return to the HTML Help home page    
Web Workshop  |  DHTML, HTML & CSS  |  HTML Help

Example: To Store Text for Pop-up Windows in a Text File


Microsoft Corporation

Updated June 10, 1999

The text for pop-up windows can be stored in one text file with the .js file name extension. This enables you to store the text for all pop-up windows in your entire help system in a single location. This also enables you to globally define the font attributes to be used for pop-up windows.

  1. Create your pop-up windows using any text editor, in the following format:

    popfont="Facename[, point size[, charset[, PLAIN BOLD ITALIC UNDERLINE]]]"
    Text1="The text for the first pop-up window."
    Text2="The text for the second pop-up window."

    where popfont is the name of the variable that specifies the font attributes for the pop-up text and Text1, Text2, and so on, are the variables that specify the text of each pop-up window.

  2. Save the file with a .js file name extension.
  3. Copy the following code into each HTML file from which you want to open a pop-up window. Place the code between the <HEAD> start and end tags:

    <OBJECT
    id=HHCTRL type="application/x-oleobject"
    classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" >
    </OBJECT>

    <SCRIPT language=javascript
    SRC="terms.js">
    </SCRIPT>

    where HHCTRL is the ID of the control that you are referencing, and terms.js is the name of your text file. You might want to include an error handler that is invoked if the specified text file cannot be found.

  4. Also copy this code in your HTML file to call the TextPopup method of the HTML Help ActiveX control:

    <A HREF="JavaScript:HHCTRL.TextPopup(Text1,popfont,9,9,-1,-1)"
    Title="Click for pop-up definition">Word to be defined</A>

Notes


link to overview topic Tips and Tricks
 


Back to topBack to top

Did you find this material useful? Gripes? Compliments? Suggestions for other articles? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.