/    Sign up×
Community /Pin to ProfileBookmark

How could I determine if other window is close?

there is a part of my website that when user click a link a pop-up window will appear.

The visitor should not close both of window else to continue processing the script in the pop up window.

My problem is how could I determine if the parent window was close by the visitor, and how can I get the exact url of the parent window.

Thanks

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliJul 03.2004 — from child window see if

top.parent is null and from parent see of

childWindowName==null
Copy linkTweet thisAlerts:
@edpudolauthorJul 04.2004 — Hello!

I try this code

if (window.parent=null){

document.writeln("Sorry you dont follow the instruction");<br/>
}

if (top.parent=null){<br/>
document.writeln("Sorry you don
t follow the instruction");

}

But still it won't work. what is the error of my code..

Thanks
×

Success!

Help @edpudol 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.19,
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,
)...