Example: To Store Text for Pop-up Windows in a Text File
- 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.
Create your pop-up windows using any text editor, in the following format:
<i>popfont</i>="<i>Facename[, point size[, charset[, PLAIN BOLD ITALIC UNDERLINE]]]</i>" <i>Text1</i>="<i>The text for the first pop-up window.</i>" <i>Text2</i>="<i>The text for the second pop-up window.</i>"
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.
Save the file with a .js file name extension.
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:
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.
Also copy this code in your HTML file to call the TextPopup method of the HTML Help ActiveX control:
- You must add the text file to the [FILES] section of your project (.hhp) file.
- This procedure cannot be used to create context-sensitive help topics that users open through an external program.