user experience design and consulting

Opening context-sensitive help by adding "h_" to the filename

This demo opens a help topic based on the current page's filename.

The advantage of this approach is that you don't have to create map IDs. Instead, just name your help topics using the same filename as your application pages with "h_" as a prefix.For example, "pagename.htm" would have a help topic named "h_pagename.htm."

How to see the demo

Click here: open help window


function openHelp() {
helpurl = location.href;
begin = begin + 1;
end=end + 1;
helpurl = "h_" + helpurl.substring(begin, end);, 'helpwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=300,height=200');

<a href="javascript:openHelp()">open help window</a>

How it works

This script uses a function named "openHelp" to open the help window. The openHelp function determines the current page's filename and adds "h_" to the beginning. It can easily be modifed to replace file extensions (for example, to replace .jsp with .htm).

Browser compatibility

This script should work in any browser.


Just send us an email.