4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Conditional window.open
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Wed Jan 29, 2003 9:33 pm (14 years, 10 months ago) Reply with QuoteBack to Top

Hi.

Can you help me with this:

I want javascript to opena window if the window called "newmessage" isn't allready open. I know how to open the window, but not how to make it not open if it is allready open.

Thank you,

________________________________
Iyonix
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
Hertzsprung
WebHelper
WebHelper


Joined: 30 Jul 2002
Posts: 56
Location: UK

PostPosted: Thu Jan 30, 2003 3:49 pm (14 years, 10 months ago) Reply with QuoteBack to Top

Iyonix wrote:
Hi.

Can you help me with this:

I want javascript to opena window if the window called "newmessage" isn't allready open. I know how to open the window, but not how to make it not open if it is allready open.


Could you use a hidden input field, or perhaps just a javascript variable as a flag indicating if the window has been opened. In your window opener function, set this flag to true the first time the window is opened. After that, the function looks at the flag and does not open the window again.

Hope that helps,
Hertzsprung
OfflineView User's ProfileFind all posts by HertzsprungSend Personal MessageVisit Poster's Website
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Thu Jan 30, 2003 4:26 pm (14 years, 10 months ago) Reply with QuoteBack to Top

Hertzsprung wrote:
Iyonix wrote:
Hi.

Can you help me with this:

I want javascript to opena window if the window called "newmessage" isn't allready open. I know how to open the window, but not how to make it not open if it is allready open.


Could you use a hidden input field, or perhaps just a javascript variable as a flag indicating if the window has been opened. In your window opener function, set this flag to true the first time the window is opened. After that, the function looks at the flag and does not open the window again.

Hope that helps,
Hertzsprung


Thanks, But that wouldn't know if the window has been closed though. Sad

________________________________
Iyonix
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
Hertzsprung
WebHelper
WebHelper


Joined: 30 Jul 2002
Posts: 56
Location: UK

PostPosted: Thu Jan 30, 2003 4:45 pm (14 years, 10 months ago) Reply with QuoteBack to Top

Iyonix wrote:
Hertzsprung wrote:

Could you use a hidden input field, or perhaps just a javascript variable as a flag indicating if the window has been opened. In your window opener function, set this flag to true the first time the window is opened. After that, the function looks at the flag and does not open the window again.

Hope that helps,
Hertzsprung


Thanks, But that wouldn't know if the window has been closed though. Sad


Ah yes, good point. Could you use an onunload event handler? But you probably couldn't update the flag because it would be accessible only by the main page, not the popuop page...
Okay, you've got me stumped. Why do you want to do this, anyway? Razz
OfflineView User's ProfileFind all posts by HertzsprungSend Personal MessageVisit Poster's Website
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Thu Jan 30, 2003 4:52 pm (14 years, 10 months ago) Reply with QuoteBack to Top

Hertzsprung wrote:
Iyonix wrote:
Hertzsprung wrote:

Could you use a hidden input field, or perhaps just a javascript variable as a flag indicating if the window has been opened. In your window opener function, set this flag to true the first time the window is opened. After that, the function looks at the flag and does not open the window again.

Hope that helps,
Hertzsprung


Thanks, But that wouldn't know if the window has been closed though. Sad


Ah yes, good point. Could you use an onunload event handler? But you probably couldn't update the flag because it would be accessible only by the main page, not the popuop page...
Okay, you've got me stumped. Why do you want to do this, anyway? Razz


A frame auto refreshes to check if the user has any new messages. If they do it opens the message window. I don't want it to open the window again if they get another message and it is allready open.

________________________________
Iyonix
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Thu Jan 30, 2003 5:10 pm (14 years, 10 months ago) Reply with QuoteBack to Top

Can anyone else help please?

I expect it will be some JS code. I am continuing to search on Google but to no avail Sad

________________________________
Iyonix
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.065775 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme