By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,830 Members | 1,724 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,830 IT Pros & Developers. It's quick & easy.

How do you make sure a frameset is loaded? I'm trying to open a frameset in a new window which shows a specific html page in a specific frame

P: n/a
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>";
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
go****@timyee.com (ck388) wrote in message news:<69**************************@posting.google. com>...
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>";


I figured out a work around. I used the ONLOAD method of the
<frameset>. I did <frameset onload=
window.frames["main"].location.replace("thePage.htm"). Make sure the
frameset page is an ASPX page so you can replace the page with the
correct page.

Regards,

Tim :-)
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.