You are here: Reference > JavaScript > client-side > dialog > methods > showHelp (window)

showHelp method (window)

Browser support:
Opens a HTML help (.chm or .hlp) file in an external application.
The attempt to display the help application is blocked by several popup blockers. If the popup is allowed, the 'file download' dialog appears.
Note that the help file can only be opened on Windows platforms or if the user has a local application to display (.chm) help files. In other browsers only downloading and manual execution is available of help files.

Syntax:

object.showHelp (URL [, ContextID]);
You can find the related objects in the Supported by objects section below.

Parameters:

URL
Required. String that specifies the location of the help file. (.chm or .htm file)
ContextID
Optional. An integer or string that specifies the context identifier in the help file.

Return value:

This method has no return value.

Example HTML code 1:

This example illustrates the use of the showHelp method:
<head>
    <script type="text/javascript">
        function OpenHelp () {
            window.showHelp ('help.chm', null);
        }
    </script>
</head>
<body>
    <button onclick="OpenHelp ();">Open a help file!</button>
</body>
Did you find this example helpful? yes no

Example HTML code 2:

This example shows how to cancel the default Help dialog of the browser:
<head>
    <script type="text/javascript">
        window.onhelp = OpenMyHelp;

        function OpenMyHelp () {
            window.showHelp ('help.chm', null);
                // cancels opening the default Help dialog of the browser
            return false;
        }
    </script>
</head>
<body>
    Press F1 to open help file
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content