JonTheBaller
Golden Member
I have a javascript function to open a window with the document as a frameset, and display a URL in a given frame. I am having a weird error.
Here is the code:
function openAnchor( anchor )
{
var helpWindow = window.open( "frames.jsp", "Frames", config="..." );
var displayURL = "page.htm#" + anchor;
helpWindow.display.location.href = displayURL;
}
I get the error helpWindow is not defined.
However, if I add an alert:
function openAnchor( anchor )
{
var helpWindow = window.open( "frames.jsp", "Frames", config="..." );
alert( "abc" );
var displayURL = "page.htm#" + anchor;
helpWindow.display.location.href = displayURL;
}
The code works - the URL is displayed in the appropriate frame (after I hit OK on the alert).
Here is the code:
function openAnchor( anchor )
{
var helpWindow = window.open( "frames.jsp", "Frames", config="..." );
var displayURL = "page.htm#" + anchor;
helpWindow.display.location.href = displayURL;
}
I get the error helpWindow is not defined.
However, if I add an alert:
function openAnchor( anchor )
{
var helpWindow = window.open( "frames.jsp", "Frames", config="..." );
alert( "abc" );
var displayURL = "page.htm#" + anchor;
helpWindow.display.location.href = displayURL;
}
The code works - the URL is displayed in the appropriate frame (after I hit OK on the alert).