Note: The information in this topic is intended for developers who need to create context-sensitive WebHelp topics.
Launching a context-sensitive WebHelp topic from a Web page is similar to launching an HTML file in a secondary window.
The example below shows one way to declare a JavaScript function that will display a secondary window. The ShowHelp function shows the specified topic in a secondary window with the attributes defined by the strHelpOptions variable.
<SCRIPT LANGUAGE="JavaScript">
var strHelpOptions = "location=no";
strHelpOptions += ",toolbar=no";
strHelpOptions += ",menubar=yes";
strHelpOptions += ",status=yes";
strHelpOptions += ",scrollbars=yes";
strHelpOptions += ",resizable=yes";
strHelpOptions += ",top=0";
strHelpOptions += ",left=0";
strHelpOptions += ",width=400";
strHelpOptions += ",height=400";
function ShowHelp(strUrl)
{
window.open(strUrl, "Help", strHelpOptions);
}
</SCRIPT>
To use ShowHelp, place the above script between the </HEAD> and <BODY> tags in the HTML file. Include an anchor tag like the following where you want the user to get help:
<A href='javascript:showhelp("widget.htm")'>help!</a>
This tag makes a hyperlink with the text "Help!" When a user clicks the hyperlink, "widget.htm" will be launched in a secondary browser window.