Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check if Javascript Window is Open

Status
Not open for further replies.

rhoenig1277

Programmer
Nov 21, 2002
24
US
I have a link on my website that will opens another website (javascript
popup) which needs authentication to login. That site is completely separate
to my site so when the user closes my site that site stays open (by design).
But since it needs the users authentication when the user opens my site again
it creates a new session for the user and kills the old which they might have
been working in. So I need a way to tell if the user opened the window and
didn't close it. I'm thinking javascript can do this but not 100% sure how?
Any suggestions?
 
I've only done this for child windows but I believe the same principal should apply. You'd need to have named the window you want to look for when you opened it.

eg. winapp=window.open();

Then you should be able to look for it with
if (winapp && winapp.open && !winapp.closed) {[somecode]}

Here is where I've gotten some of my info.

Hope that helps
Rois
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top