/    Sign up×
Community /Pin to ProfileBookmark

Parent window closes after pop-up open

I have a webpage with a flash mp3 player on it. I want to close the parent window and have the mp3 player open in a pop-up window, however, I can’t get the parent page to close afterward. I got everything to work except the closing of the Parent window. Help!

Here’s what I have that opens the pop up window.

<a href=’JavaScript:popupWindow(“URL” ,300,320)’>Pop-up Player</a>

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@KravvitzMar 03.2006 — You can't. Only windows opened via window.open() can be closed via JavaScript.
Copy linkTweet thisAlerts:
@HoiPolloiauthorMar 03.2006 — How can I do that then? I just need to know how I can click on a link that opens a new browser that is a specific size and closes the parent window. Would I be able to do that?
Copy linkTweet thisAlerts:
@KravvitzMar 03.2006 — You can specify the size of the window when you use window.open(), but since the parent wasn't created by window.open(), you can't use window.close() to close it.
Copy linkTweet thisAlerts:
@HoiPolloiauthorMar 03.2006 — Can you help me out with the coding?
Copy linkTweet thisAlerts:
@KorMar 03.2006 — Can you help me out with the coding?[/QUOTE]
Read attentively:

since the parent wasn't created by window.open(), you [B][COLOR=Red]can't[/COLOR][/B] use window.close() to close it.
[/quote]
×

Success!

Help @HoiPolloi 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.29,
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,
)...