4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu
Please consider registering: registration is fast, easy and free! Benefits of registration:
  • Free advertising for your website: Every post in our forums goes towards a "credit" of ads, which are displayed on most pages of our forums. Each post gives you 400 ad impressions. To submit your ad, edit your profile.
  • Discount at TemplateMonster: All our members enjoy a 10% discount at TemplateMonster.com!
  • Private Messages: Exchange private messages with other members of the forums.
  • Message Tracking/Subscription: phpBB enables you to subscribe to threads which interest you, and will then email you when a reply is posted. phpBB also remembers which posts registered users have read during a session, which means you can keep track of which posts you have already looked at.

 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: 88
Location: Yarm, England

PostPosted: Wed Jan 29, 2003 9:33 pm (10 years, 3 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: 57
Location: UK

PostPosted: Thu Jan 30, 2003 3:49 pm (10 years, 3 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: 88
Location: Yarm, England

PostPosted: Thu Jan 30, 2003 4:26 pm (10 years, 3 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: 57
Location: UK

PostPosted: Thu Jan 30, 2003 4:45 pm (10 years, 3 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: 88
Location: Yarm, England

PostPosted: Thu Jan 30, 2003 4:52 pm (10 years, 3 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: 88
Location: Yarm, England

PostPosted: Thu Jan 30, 2003 5:10 pm (10 years, 3 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.064055 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme