The script detailed by tsimmons doesn't exactly work.
It works in the sample page, but the links all originate from
the same page. To emulate a web application, I produced two pages,
each with the page specific help link copied directly from the
tsimmons sample.
First help click works great. It appears for the specific
page, in the defined window.
If you move to a second web app page and click its help link,
with the corresponding topic specified in the link, the help window
appears correctly, but does not insert the new, second topic. You
have to reclick a second time to get the insertPage function to
place the corresponding help for the second page.
Does the ordering of the functions in the script cause this
problem?
The sample pages are at
here.
I did remove the javascript from the test web pages and
referenced a single .js file. Could this be an issue?
Here is the js code, only slightly modified from the tsimmons
sample to remove the search and read title functions.
var thisTitle = this.document.title;
var winExists = "";
var searchExists = "";
var newWin
var newSearch
function makeUrl(strUrl) {
if (newWin && !newWin.closed) {
strUrl = "WebHelp/" + strUrl;
showPage(strUrl);
}
else {
winExists="";
strUrl = "WebHelp/cshlp.htm#" + strUrl;
showPage(strUrl);
}
}
function showPage(strUrl) {
if (winExists=="") {
openWindow(strUrl);
}
else {
insertPage(strUrl);
}
}
function openWindow(strUrl) {
var w_left = (screen.width/8);
var w_top = (screen.height/8);
var w_width = (screen.width/2);
var w_height = (screen.height/2);
var strOptions = "location=no";
strOptions += ",toolbar=yes";
strOptions += ",menubar=no";
strOptions += ",status=no";
strOptions += ",scrollbars=yes";
strOptions += ",resizable=yes";
strOptions += ",left=" + w_left;
strOptions += ",top=" + w_top;
strOptions += ",width=" + w_width;
strOptions += ",height=" + w_height;
strOptions += ";";
newWin = window.open(strUrl, "newWin", strOptions);
winExists = 1;
newWin.document.close();
newWin.focus();
}
function insertPage(strUrl) {
newWin.frames[1].frames[1].location.href = strUrl;
newWin.document.close();
newWin.focus();
}
-->