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

**URL:** https://boards.straightdope.com/t/web-geeks-can-i-open-a-popup-from-a-popup/279215
**Category:** Factual Questions
**Created:** [December 10, 2004, 9:45pm UTC](https://boards.straightdope.com/t/web-geeks-can-i-open-a-popup-from-a-popup/279215 "2004-12-10T21:45:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![DougC](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@DougC](https://boards.straightdope.com/u/DougC)
#### Post date: [December 10, 2004, 9:45pm UTC](https://boards.straightdope.com/t/web-geeks-can-i-open-a-popup-from-a-popup/279215/1 "2004-12-10T21:45:27Z")

</div>

…_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?  
~

---

<div class="post-metadata">

### Author: ![Terminus\_Est](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/terminus_est/32/3087_2.png) [@Terminus\_Est](https://boards.straightdope.com/u/Terminus_Est)
#### Post date: [December 10, 2004, 11:29pm UTC](https://boards.straightdope.com/t/web-geeks-can-i-open-a-popup-from-a-popup/279215/2 "2004-12-10T23:29:48Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Tim\_T-Bonham.net](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@Tim\_T-Bonham.net](https://boards.straightdope.com/u/Tim_T-Bonham.net)
#### Post date: [December 10, 2004, 11:46pm UTC](https://boards.straightdope.com/t/web-geeks-can-i-open-a-popup-from-a-popup/279215/3 "2004-12-10T23:46:43Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)
#### Post date: [December 10, 2004, 11:56pm UTC](https://boards.straightdope.com/t/web-geeks-can-i-open-a-popup-from-a-popup/279215/4 "2004-12-10T23:56:10Z")

</div>

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:

```auto

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

```

foo.html:

```auto

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

```

That’s all there is to it.
