It's not a secret anymore!
The moose likes HTML, CSS and JavaScript and the fly likes check whether a page is loaded Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "check whether a page is loaded " Watch "check whether a page is loaded " New topic

check whether a page is loaded

Karishma Kuriachan

Joined: Sep 19, 2007
Posts: 5
I need to open a new window(having same url as parent window)from parent window. Can we somehow check whether a new is completely loaded in the javascript so that I can do some manupulations on new window?

function fnFloat(){
/* getting the url of current(parent window */
alert("before rewriting:"+url);
/* rewriting the url pass one variable through url*/
alert("after rewriting:"+url);
/* opening new window with the same url(with variable float)*/
myWin =''+url,'myWin','left=20,top=20,width=800,height=500,toolbar=1,resizable=1,scrollbars=1,location=1');

/* want to do some manupulation here with 'myWin' object.... such as
myWin.document.getElementById("float"); which is not working...I am getting null value as the new window is not loaded*/

Can anyone suggest some solution for this??

Thanks in advance,
[ September 20, 2007: Message edited by: Karishma Kuriachan ]
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
You can not call the window to read its content until after the window has fully loaded.

Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
You can go the other way ...

Now it's up to script in the new window to call parent.acceptDataFromChild() when it's fully loaded. Does that make sense?

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I agree. Here's the link:
subject: check whether a page is loaded
It's not a secret anymore!