Javascript Pop Up windows

marky9074
marky9074 used Ask the Experts™
on
A question which unfortunately asks for a multitude of answers!

Using DW MX to call a new browser window using the 'Open Browser Window', the new browser pops up OK but in the first instance always appears in the background rather than the foreground.  Every instance after this is OK (in the foreground).  Is there any way I can stop the first instance from opening up in the background?  

Also I have noticed an annoying side effect of this.  My Dad who was previewing the code on his laptop has a touch pad which offen double clicks on a single click.  The result of this being that one new browser window pops up in the background whilst another one pops up in the foreground.  Due to the speed of the double click the window in the foreground comes up with an error and does not display the html.  Testing this a small delay is OK, but the action of a 'double click' brings up a window with an error.....................Is there any way I can only have one instance of the new window up at any one time, until of course it is shut down again.

Hope this makes sense,

Mark
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
I'm guessing here based on a similar experience.
1. Make sure you do not have a normal link in your property inspector, the behaviour should be the only place in where the link to your file is. The propert inspector should have a link like # or javascript:;
2. Make sure you have not set a target for the link, it should not say _blank or anything else, it should be empty

Based in this I don't think your father double-clicks, I think your code actually, by mistake, is opening 2 windows :-)

Another great tutorial, which is very is to understand is found at http://apptools.com/rants/popups.php

Let me know if this help!

-klykken
Top Expert 2004
Commented:
Also make sure to give every popup window a name, and in your case, the same one. That way you'll only have a single window open.
If you can supply the code, it will probably show why the initial one is not focussing on load.

Author

Commented:
Hi klykken,

I had tried it both ways with Javascript:; and a normal link in the property inspector link.  Either way, if you are too quick it pops a window up with errors....

I am most gratefull for the link though, as the 'return false' is most usefull if you keep the link rather than the null javascript method.  I didn't know that.  When testing in IE only the javascript window(s) come up, whereas in Mozilla both the js and a new browser come up, and I had wondered why!

Thanks,

Mark
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

Commented:
marky9074,
hmm.. could you give me the link to your page? Without looking at the exact code I am not sure what happens with your page :-)

-klykken

Author

Commented:
Hi Guys,

Thanks for the help, after changing it back to javascript:;, removing the target="_blank" and naming the window the same as the html file all my problems appear to have dissapeared.  The latter fixing my problem with the window being in the background as well.  At the moment have not had any reports of any double windows.....

www.marky9074.f2s.com/home.htm

Thanks for your help, it was much appreciated,

Mark
Top Expert 2004

Commented:
Your welcome, and best of luck Mark.
Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial