-
javascript
Here is a script that I am using:
function ShowHelp(PageName)
{
var HelpWindow;
HelpWindow = window.open(pagename,"help","left=600,height=300,width=200");
HelpWindow.focus;
}
And this is the link that I am usiing to use the function;
<div align="right"><a href="#" onclick="ShowHelp('ctcHelp.htm')">Help</a></div>
But there is an error, and it is:
pagename is not defined.
Does this mean that I have to declare pagename somewhere as the parameter of ShowHelp?
Thanks
-
Your passing in PageName, but you are trying to use pagename. Note the case. JavaScript is case sensitive, therefore, myvariable and Myvariable are two different variables.
Try this:
function ShowHelp(pagename)
{
var HelpWindow;
HelpWindow = window.open(pagename,"help","left=600,height=300,width=200");
HelpWindow.focus;
}