Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > 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

Reply
Thread Tools

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

 
 
ck388
Guest
Posts: n/a
 
      09-24-2003
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>";
 
Reply With Quote
 
 
 
 
ck388
Guest
Posts: n/a
 
      09-24-2003
(ck38 wrote in message news:<. 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Passing values from Child window with frameset to Parent window with frameset jimmyfishbean@yahoo.co.uk Javascript 0 07-11-2006 09:05 AM
Changing src of a frame of a frameset within another frameset? Julius Mong Javascript 1 05-10-2004 07:35 PM
Help - Not sure how to phrase this ... need a script which shows dynamic hyperlinked results in an iframe Pat Hoback Javascript 0 04-08-2004 08:12 PM
Link to open a frameset page to a specific url in a frame? B.G. Javascript 3 12-30-2003 06:55 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57