473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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

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
1 3906
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Scott | last post by:
I need help to modify the code below to pass url variables from a framset. The click to run this will be in the mainFrame. This script works well in a non-frame page. Grabs the current url...
1
by: Julius Mong | last post by:
Dear all, I have the following: <html> <head> .... </head> <frameset ...> <frame .../> <frameset name="page" rows="60,*" ...> <frame src='top.html' .../>
4
by: Frances Del Rio | last post by:
sorry, but need to post entire frameset here to ask my question: <frameset rows="79,344,107"> <frame name="header" src="header.html"> <frame name="player" src="mediaselect.html"> <frameset...
2
by: JPL Verhey | last post by:
(i hope somebody (else) will read and have an idea! Thnx) Hi, With a script in a popup window, I want to check if certain content is present in a page loaded into the frame "main" of the...
14
by: Alex Molochnikov | last post by:
Is there any way to embed the HTML code inside FRAMESET? Something like this: <frameset cols="50%,*"> <frame src=" ... HTML code for the frame ... "> <frame src="Frame2.html" name="main">...
2
by: TR | last post by:
Given the following frameset named MyFrameSet.htm: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> <html> <head><TITLE>LaunchFrame</TITLE> <FRAMESET ROWS="88%,12%"> <FRAME...
2
by: Guadala Harry | last post by:
I have some pages that open in a frameset. I want them to be opened *only* in the frameset (and not on their own). How can I disallow a page from being opened on its own (i.e., allow to be opened...
6
by: Stefan Mueller | last post by:
After my web page has been loaded I'm doing some tests with a JavaScript. If I figure out that something is wrong I'd like to reload the whole frameset. With Internet Explorer and Mozilla Firefox...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.