By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,594 Members | 3,291 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,594 IT Pros & Developers. It's quick & easy.

verify popup window is open from multiple pages

P: n/a
Hi,

I've looked for a solution to this problem on google, read posts in
this newsgroup and I still haven't found anything that could help me.

Here's the scenario.

1. User accesses pageA.html
2. User clicks on menu link to open popup.html
3. pageA.html checks if popup.html is already open. It is not, open
popup.html.
4. User switches back to pageA.html (does not close popup.html)
5. User clicks menu link for pageB.html.
6. System displays pageB.html
7. User clicks menu to open popup.html
8. pageB.html checks if popup.html is already open. If it is, focus is
made on popup.html. If it isn't, popup.html is opened.

Anyone can help?

Much appreciated,
Anthony.

May 14 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Bump - anyone can help? I'm still stranded.

May 18 '06 #2

P: n/a
an**************@gmail.com wrote:
Bump - anyone can help? I'm still stranded.

With what? Please quote the context you are replying to. See
<http://cfaj.freeshell.org/google/>.

If you post the code you are having trouble with, you might get some help.

--
Ian Collins.
May 18 '06 #3

P: n/a
Ian Collins wrote:
an**************@gmail.com wrote:
Bump - anyone can help? I'm still stranded.

With what? Please quote the context you are replying to. See
<http://cfaj.freeshell.org/google/>.

If you post the code you are having trouble with, you might get some help.

--
Ian Collins.

Sorry for the newbiness. :)

Here was my original query.
-----

Hi,
I've looked for a solution to this problem on google, read posts in
this newsgroup and I still haven't found anything that could help me.

Here's the scenario.

1. User accesses pageA.html
2. User clicks on menu link to open popup.html
3. pageA.html checks if popup.html is already open. It is not, open
popup.html.
4. User switches back to pageA.html (does not close popup.html)
5. User clicks menu link for pageB.html.
6. System displays pageB.html
7. User clicks menu to open popup.html
8. pageB.html checks if popup.html is already open. If it is, focus is
made on popup.html. If it isn't, popup.html is opened.

Anyone can help?

Much appreciated,
Anthony.

May 20 '06 #4

P: n/a
an**************@gmail.com said the following on 5/20/2006 1:09 PM:
Ian Collins wrote:
an**************@gmail.com wrote:
Bump - anyone can help? I'm still stranded.
With what? Please quote the context you are replying to. See
<http://cfaj.freeshell.org/google/>.

If you post the code you are having trouble with, you might get some help.

--
Ian Collins.

Sorry for the newbiness. :)

Here was my original query.
-----

Hi,
I've looked for a solution to this problem on google, read posts in
this newsgroup and I still haven't found anything that could help me.

Here's the scenario.

1. User accesses pageA.html
2. User clicks on menu link to open popup.html


User's pop up blocker doesn't allow that page to open, but okay.

But, does it get opened via target= or by window.open?
3. pageA.html checks if popup.html is already open. It is not, open
popup.html.
Use the same name in the name/target, the browser will handle the rest.
4. User switches back to pageA.html (does not close popup.html)
5. User clicks menu link for pageB.html.
6. System displays pageB.html
7. User clicks menu to open popup.html
8. pageB.html checks if popup.html is already open. If it is, focus is
made on popup.html. If it isn't, popup.html is opened.


You will run into problems trying to focus a popup and bring it to the
front. But again, you use the same name/target in the code and the
browser will handle the rest.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 21 '06 #5

P: n/a

Randy Webb wrote:
an**************@gmail.com said the following on 5/20/2006 1:09 PM:
Ian Collins wrote:
an**************@gmail.com wrote:
Bump - anyone can help? I'm still stranded.

With what? Please quote the context you are replying to. See
<http://cfaj.freeshell.org/google/>.

If you post the code you are having trouble with, you might get some help.

--
Ian Collins.

Sorry for the newbiness. :)

Here was my original query.
-----

Hi,
I've looked for a solution to this problem on google, read posts in
this newsgroup and I still haven't found anything that could help me.

Here's the scenario.

1. User accesses pageA.html
2. User clicks on menu link to open popup.html


User's pop up blocker doesn't allow that page to open, but okay.

But, does it get opened via target= or by window.open?


I use window.open (would I be better off with target= ?), and I thought
that a popup blocker wouldn't mind because it was user action that
brought the popup to life. Anyhow, I haven't seen a popup blocker
mind... yet. :)
3. pageA.html checks if popup.html is already open. It is not, open
popup.html.


Use the same name in the name/target, the browser will handle the rest.


If the popup is already opened and I use the same name/target, it will
refresh the popup. Let's say the content of the popup has changed since
its original creation; in that case, I don't want the popup window to
be "re-opened" over the current content. So how do I go about doing
that?
4. User switches back to pageA.html (does not close popup.html)
5. User clicks menu link for pageB.html.
6. System displays pageB.html
7. User clicks menu to open popup.html
8. pageB.html checks if popup.html is already open. If it is, focus is
made on popup.html. If it isn't, popup.html is opened.


You will run into problems trying to focus a popup and bring it to the
front. But again, you use the same name/target in the code and the
browser will handle the rest.


Likewise, given the popup is already opened, I haven't found a way to
"only" focus the window, without refreshing it/loading content inside.
My problem seems to be that as I navigated to pageB.html, I've lost the
reference on the popup.html window; more importantly, I can't find a
way to simply get that reference, without loading any content in the
popup window if it exists.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


Maybe I'm missing something... thanks for taking the time!
Anthony.

May 21 '06 #6

P: n/a
an**************@gmail.com said the following on 5/20/2006 1:50 PM:
Randy Webb wrote:
an**************@gmail.com said the following on 5/20/2006 1:09 PM:
Ian Collins wrote:
an**************@gmail.com wrote:
> Bump - anyone can help? I'm still stranded.
>
With what? Please quote the context you are replying to. See
<http://cfaj.freeshell.org/google/>.

If you post the code you are having trouble with, you might get some help.

--
Ian Collins.

Sorry for the newbiness. :)

Here was my original query.
-----

Hi,
I've looked for a solution to this problem on google, read posts in
this newsgroup and I still haven't found anything that could help me.

Here's the scenario.

1. User accesses pageA.html
2. User clicks on menu link to open popup.html User's pop up blocker doesn't allow that page to open, but okay.

But, does it get opened via target= or by window.open?


I use window.open (would I be better off with target= ?), and I thought
that a popup blocker wouldn't mind because it was user action that
brought the popup to life. Anyhow, I haven't seen a popup blocker
mind... yet. :)


Ever seen the way that Symantec's Norton blocks popups? It redefines the
window.open call by script and injects it in the page before any other
content. It will stop a window.open call dead in it's tracks - user
initiated or not.

var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
Test that with your popup code :)
3. pageA.html checks if popup.html is already open. It is not, open
popup.html.

Use the same name in the name/target, the browser will handle the rest.


If the popup is already opened and I use the same name/target, it will
refresh the popup.


Only if it is the same page.
Let's say the content of the popup has changed since its original
creation; in that case, I don't want the popup window to be "re-opened"
over the current content. So how do I go about doing that?
The popup won't be "re-opened", it is reused.
4. User switches back to pageA.html (does not close popup.html)
5. User clicks menu link for pageB.html.
6. System displays pageB.html
7. User clicks menu to open popup.html
8. pageB.html checks if popup.html is already open. If it is, focus is
made on popup.html. If it isn't, popup.html is opened. You will run into problems trying to focus a popup and bring it to the
front. But again, you use the same name/target in the code and the
browser will handle the rest.


Likewise, given the popup is already opened, I haven't found a way to
"only" focus the window, without refreshing it/loading content inside.


You can't. Not short of closing it and reopening it and then hoping it
stays in the front.
My problem seems to be that as I navigated to pageB.html, I've lost the
reference on the popup.html window; more importantly, I can't find a
way to simply get that reference, without loading any content in the
popup window if it exists.


The second parameter to window.open is the name of that window.

window.open(URL,winName,parameters)

<a href="someURL" target="winName">Some Page</a>

Open that first popup, then click the link. See where it loads at...

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 21 '06 #7

P: n/a

Randy Webb wrote:
an**************@gmail.com said the following on 5/20/2006 1:50 PM:
Randy Webb wrote:
an**************@gmail.com said the following on 5/20/2006 1:09 PM:
Ian Collins wrote:
> an**************@gmail.com wrote:
>> Bump - anyone can help? I'm still stranded.
>>
> With what? Please quote the context you are replying to. See
> <http://cfaj.freeshell.org/google/>.
>
> If you post the code you are having trouble with, you might get some help.
>
> --
> Ian Collins.

Sorry for the newbiness. :)

Here was my original query.
-----

Hi,
I've looked for a solution to this problem on google, read posts in
this newsgroup and I still haven't found anything that could help me.

Here's the scenario.

1. User accesses pageA.html
2. User clicks on menu link to open popup.html
User's pop up blocker doesn't allow that page to open, but okay.

But, does it get opened via target= or by window.open?
I use window.open (would I be better off with target= ?), and I thought
that a popup blocker wouldn't mind because it was user action that
brought the popup to life. Anyhow, I haven't seen a popup blocker
mind... yet. :)


Ever seen the way that Symantec's Norton blocks popups? It redefines the
window.open call by script and injects it in the page before any other
content. It will stop a window.open call dead in it's tracks - user
initiated or not.

var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
Test that with your popup code :)
3. pageA.html checks if popup.html is already open. It is not, open
popup.html.
Use the same name in the name/target, the browser will handle the rest.


If the popup is already opened and I use the same name/target, it will
refresh the popup.


Only if it is the same page.
Let's say the content of the popup has changed since its original
creation; in that case, I don't want the popup window to be "re-opened"
over the current content. So how do I go about doing that?


The popup won't be "re-opened", it is reused.
4. User switches back to pageA.html (does not close popup.html)
5. User clicks menu link for pageB.html.
6. System displays pageB.html
7. User clicks menu to open popup.html
8. pageB.html checks if popup.html is already open. If it is, focus is
made on popup.html. If it isn't, popup.html is opened.
You will run into problems trying to focus a popup and bring it to the
front. But again, you use the same name/target in the code and the
browser will handle the rest.


Likewise, given the popup is already opened, I haven't found a way to
"only" focus the window, without refreshing it/loading content inside.


You can't. Not short of closing it and reopening it and then hoping it
stays in the front.

Baaah, there we have it. I can't. I'll have to find a way to do this in
another way...
My problem seems to be that as I navigated to pageB.html, I've lost the
reference on the popup.html window; more importantly, I can't find a
way to simply get that reference, without loading any content in the
popup window if it exists.


The second parameter to window.open is the name of that window.

window.open(URL,winName,parameters)

<a href="someURL" target="winName">Some Page</a>

Open that first popup, then click the link. See where it loads at...

Thanks a lot for your time,
Anthony.

May 21 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.