I am trying to open a frameset in a new window......where the frame
called "main" shows the file called customerGeneral.aspx. I can't get
it to work though...i always get something like frames.main.location
is null....seems like the frameset is not loaded before
wnd.frames["main"].location.replace(URL) is called. If i add an
alert("TEST") between the window open and the frame
replacement....then it works. The alert("TEST") seems to ensure that
the frameset is loaded so the wnd.frames["main"].location.replace(URL)
executes without an error of null.
I have included my code below.
Any suggestions?
function openInFrame(URL) {
var wnd = window.open('frames/main.htm');
// if i add this alert("TEST") it works.
wnd.frames["main"].location.replace(URL);
}
e.Item.Cells[1].Text = "<a href=\"javascript:void(0)\"
onclick=\"openInFrame('" + "customerGeneral.aspx?ID=" + ID + "')\">" +
"This is a test" + "</a>";