Web Geeks: can I open a popup from a popup?

without any server-side scripting?

      • A place I do occasional web work for has requested I make a page (customers.html). And on this customers.html page is to be a popup link, that opens popup#1, which is a list of client names with brief info. And each of these client names in this popup is to be a popup-link itself, that when pressed, opens a new window that then goes to each customers’ own websites. Don’t ask me what I think of this idea. Let’s just say it’s not my idea.

The problem I am seeing is that the first popup opened (and left open) automatically becomes the target for any other popup links clicked. It does not matter if the second popup variable is declared in the popup page or the parent page.

  • I’d prefer a method that works for all major browsers; is there a way to do this without server-side scripting, and hopefully without vbscript?
    ~

Opening a popup window (whether from the original window or another popup) is simply JavaScript - no server-side scripting involved. I hate popups, so you’ll have to figure it out for yourself. I just hint that each window can get a different name.

Don’t we have rules against telling someone how to do something illegal?

And if generating popup windows isn’t illegal, it sure ought to be!

There’s a difference between automatic popups and those which are requested by clicking a link. THey can still be annoying though.

Anyway, the following works fine for me.

customers.html:



<a href="foo.html" onClick="window.open('foo.html', 'foo');">foo</a>


foo.html:



<a href="bar.html" onClick="window.open('bar.html', 'bar');">bar</a>


That’s all there is to it.