473,395 Members | 1,885 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,395 software developers and data experts.

trouble updating new window frame

ced

Hallo,

I have some JS which creates a new 2-frame window.
The new window (via onLoad) backfills a variable
in the parent window so I'll know when it's safe
to load the target frame.

The problem is that no matter what kind of delay
I set (1 or more seconds), trying to update the
new frame always generates a 'newwin no properties'
type error.

If I introduce a single alert call for debugging,
the target frame update works fine; otherwise never.

This occurs with modern versions of both IE and
Mozilla. Here's the JS:

var loaded = null;
....

function checkload() {return loaded ? true : false;}

function update() {
if ( !newwin || newwin.closed ) {
newwin = window.open('/path/some.html', '','query' );
newwin.focus();
}
....
if ( checkload() ) {
//alert("loaded=" + loaded); // loads fine
clearTimeout(window.id);
} else {
window.id = setTimeout('checkload()', 1000);
}
newwin.frames[1].location.href='/path/cgi/some.cgi?qrystr';

Any thoughts appreciated.

Rgds,
--
Charles DeRykus

Oct 31 '05 #1
4 1473
ce*@carios2.ca.boeing.com a écrit :
Hallo,

I have some JS which creates a new 2-frame window.
The new window (via onLoad) backfills a variable
in the parent window so I'll know when it's safe
to load the target frame.

The problem is that no matter what kind of delay
I set (1 or more seconds), trying to update the
new frame always generates a 'newwin no properties'
type error.

If I introduce a single alert call for debugging,
the target frame update works fine; otherwise never.

This occurs with modern versions of both IE and
Mozilla. Here's the JS:

var loaded = null;
...

function checkload() {return loaded ? true : false;}

function update() {
if ( !newwin || newwin.closed ) {
newwin = window.open('/path/some.html', '','query' );
newwin.focus();
If the new window is closed or if its reference in memory is inexistent,
then you create it: then why would you need to focus it if it is going
to be created?
}
...
if ( checkload() ) {
//alert("loaded=" + loaded); // loads fine
clearTimeout(window.id);
} else {
window.id = setTimeout('checkload()', 1000);
How/what is the code suppose to do with id here? there is no id property
for window.
}
newwin.frames[1].location.href='/path/cgi/some.cgi?qrystr';

Any thoughts appreciated.

Rgds,

Can you provide an url where this problem happens? An url for the
[path]/some.html and for its opener. As filed, it's very difficult to
guess what's needed ..

Gérard
--
remove blah to email me
Nov 1 '05 #2
ced

Gérard Talbot wrote:
ce*@carios2.ca.boeing.com a écrit :
Hallo,

I have some JS which creates a new 2-frame window.
The new window (via onLoad) backfills a variable
in the parent window so I'll know when it's safe
to load the target frame.

The problem is that no matter what kind of delay
I set (1 or more seconds), trying to update the
new frame always generates a 'newwin no properties'
type error.

If I introduce a single alert call for debugging,
the target frame update works fine; otherwise never.

This occurs with modern versions of both IE and
Mozilla. Here's the JS:

var loaded = null;
...

function checkload() {return loaded ? true : false;}

function update() {
if ( !newwin || newwin.closed ) {
newwin = window.open('/path/some.html', '','query' );
newwin.focus();
If the new window is closed or if its reference in memory is inexistent,
then you create it: then why would you need to focus it if it is going
to be created?


Hm, the update will occur in that window so I wanted it to
be visible. As I recall, it remains submerged sometimes
without the focus call.
}
...
if ( checkload() ) {
//alert("loaded=" + loaded); // loads fine
clearTimeout(window.id);
} else {
window.id = setTimeout('checkload()', 1000);


How/what is the code suppose to do with id here? there is no id property
for window.


You're right -- I forgot that declaration.
}

...

Fortunately, I made a change to setTimeout and everything is fine.
Here's the change:

window.id = setTimeout('update()', 1000);

This works every time. I'm not sure why -- the scope makes more
sense to me as I think about what's happening though.

Thanks,
--
Charles DeRykus

Nov 1 '05 #3
ce*@carios2.ca.boeing.com a écrit :
Gérard Talbot wrote:
ce*@carios2.ca.boeing.com a écrit :
Hallo,

I have some JS which creates a new 2-frame window.
The new window (via onLoad) backfills a variable
in the parent window so I'll know when it's safe
to load the target frame.

The problem is that no matter what kind of delay
I set (1 or more seconds), trying to update the
new frame always generates a 'newwin no properties'
type error.

If I introduce a single alert call for debugging,
the target frame update works fine; otherwise never.

This occurs with modern versions of both IE and
Mozilla. Here's the JS:

var loaded = null;
...

function checkload() {return loaded ? true : false;}

function update() {
if ( !newwin || newwin.closed ) {
newwin = window.open('/path/some.html', '','query' );
newwin.focus();


If the new window is closed or if its reference in memory is inexistent,
then you create it: then why would you need to focus it if it is going
to be created?

Hm, the update will occur in that window so I wanted it to
be visible. As I recall, it remains submerged sometimes
without the focus call.


The window is to be created, not updated. A newly created window is not
"submerged" like you say. It "pops" up on top of all other windows.

Gérard
--
remove blah to email me
Nov 1 '05 #4
ced

Gérard Talbot wrote:
ce*@carios2.ca.boeing.com a écrit :
Gérard Talbot wrote:
ce*@carios2.ca.boeing.com a écrit :

.....
Hm, the update will occur in that window so I wanted it to
be visible. As I recall, it remains submerged sometimes
without the focus call.


The window is to be created, not updated. A newly created window is not
"submerged" like you say. It "pops" up on top of all other windows.

True, perhaps, something else occurred to cause the newly
created window to lose focus. At any rate, the focus of
the newly created window wasn't the real issue and the problem
has dissolved with the change to SetTimeout.

--
Charles DeRykus

Nov 2 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: VK | last post by:
Hi! What I'm missing in following code? Cannot get the values of radiobuttons. Starting only one class (GetVariant), it works. When I put two classes together, it doesn't. Regards, VK from...
33
by: randau | last post by:
Linking to a Targeted Browser Window I'd like to open reference links to other web sites in a separate browser window from the browser window hosting my own web site pages. The Link Target...
3
by: Jim Cobban | last post by:
I have a set of web pages that are organized in pairs. One of each pair contains a graphic and the other is an extended description of the graphic. I am trying to set it up that selecting a single...
2
by: FP | last post by:
I'm displaying a list of messages. Each message can be checkmarked as done or not done. When a user clicks on the checkmark I want the following to happen; - checkbox status is toggled between...
1
by: redpayne | last post by:
Ok-I am doing homework out of a book and the instructions are to display an interface with 5 option buttons in a frame. When clicked, each button changes the background color of the frame. It...
18
by: fishwick | last post by:
I haven't really done any css in quite a while, and am banging my head against the wall trying get the rudimentary layout together of a church website home page to display correctly - I don't want...
2
by: netling | last post by:
Ok, Here is my situation... we have a 64 page pdf that we have broken up into separate pages. We are needing a frame set to have a "Previous Page and Next Page" navigation at the bottom of the...
4
by: Daniel Gee | last post by:
I'm trying to learn WxPython with the tutorial: http://wiki.wxpython.org/Getting_Started But I can't seem to get the example for events to work. I pasted the code they had directly into an...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.