|
-
May 3rd, 2003, 01:45 AM
#1
Thread Starter
Frenzied Member
JavaScript popup windows onLoad event
If I popup a window by doing
var newwin = window.open(Url, Name, Properties);
Is there a way to know on the opener page when the popup finishes loading? I have a page that is basicly a copy of another domains page with all the links going to the other domain. (don't ask why, it just makes it look like part of the site I am building). The problem is that none of the links work unless the browser has a cookie from that domain. I thought about opening a page from their site in a hidden iframe so that you wouldn't know you were loading it, but IE 6 defaults to not allowing cookies from a different domain. I finally came up with the idea of loading a popup of their site, and closing it after 1 or 2 seconds. It works most of the time, but sometimes it closes before the cookie loads. I just need to know when the popup is done loading, so that I can close it.
-
May 6th, 2003, 03:18 AM
#2
In the popup's onload:
window.opener.notifyLoaded();
where notifyLoaded is a function you define in the main window.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
May 8th, 2003, 10:37 PM
#3
Thread Starter
Frenzied Member
I don't have access to the popup html. What I need, and probably can't get is to know when the popup loads from the opener.
-
May 9th, 2003, 01:38 AM
#4
I don't think that's possible without a timer.
But you could try this:
Code:
var win = null;
function setOnLoad()
{
if(!win)
return;
if(win && !win.document.body) {
setTimeout(100, setOnLoad);
return;
}
win.document.body.onload = pageLoaded;
}
function createWin()
{
win = window.open(blabla);
setOnLoad();
}
Not sure if it works though.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
May 9th, 2003, 09:48 AM
#5
Thread Starter
Frenzied Member
Hey that is a great idea!!! I will try that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|