/    Sign up×
Community /Pin to ProfileBookmark

pass window handler?

Hi,

I am thinking about open a messeage dialog in the main window and close it in the child window.So I am wondering if I can pass the window handler(the message window) to the child window.Is this possible?How could I achieve this?Thanks

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisJun 12.2004 — If the window has a NAME, you can create a handle.
var pop = window.open("", "windowNameGoesHere");
Note that the URL is not affected by this command.
Copy linkTweet thisAlerts:
@azure_ssauthorJun 14.2004 — Thanks you.

One more question:

If I want to open the message window in a button click event and then close it in the body onload event,how can I save the handler in the page?I think global variable won't work because it can't across requests.Thanks
Copy linkTweet thisAlerts:
@gil_davisJun 14.2004 — Like I said, you make a handle using the window's name. You don't have to pass anything.
Copy linkTweet thisAlerts:
@azure_ssauthorJun 15.2004 — I mean in the same page,how could you popup the message window before the main window submit and close the popup window after the main window is loaded?Thanks
Copy linkTweet thisAlerts:
@azure_ssauthorJun 15.2004 — Problem solve,thanks
Copy linkTweet thisAlerts:
@azure_ssauthorJun 15.2004 — Ok,one more question.

I use the window.open("","windowname") to get the handler of the named window.But the problem is if the window is already close,this statement will open a blank window which I don't want.How can I check the window's existence by its name? or anyway to suspence(or hide) this blank window to popup?Thanks
Copy linkTweet thisAlerts:
@gil_davisJun 16.2004 — Unfortunately, you can't tell if a window is closed until you have a handle for it. So if you open the window and it does not have the expected URL (pop.window.location.href), then just close it. Or, you could load it with the desired URL.
×

Success!

Help @azure_ss spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...