/    Sign up×
Community /Pin to ProfileBookmark

Window object

Hello everyone,

Does anybody know whether it is possible to refer to a parent window from popup one?

To give an example: when my website is downloading a new window pops up, which offers an option to choose another language. Once a language is chosed, I would like new pages to be opened in the parent window, i.e in the window which triggered popup. Any ideas how I can do it?

Many thanks in advance,

?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@pyroJan 21.2003 — [i]Originally posted by les [/i]

[B]Does anybody know whether it is possible to refer to a parent window from popup one?[/B][/QUOTE]
window.opener is how your reference a parent window.

[i]Originally posted by les [/i]

[B]Once a language is chosed, I would like new pages to be opened in the parent window, i.e in the window which triggered popup.[/B][/QUOTE]
I believe window.opener.location="http://www.yoursite.com/english"; is how you'd do that...
Copy linkTweet thisAlerts:
@wraighsjJan 21.2003 — you can access all aspects of the parent using "top.opener."
Copy linkTweet thisAlerts:
@lesauthorJan 21.2003 — pyro, wraighsj,

Thanks for your help. It works! ?
×

Success!

Help @les 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.24,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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