My site is at and I have one issue.

I have two pop up windows:
1) Detatchable CD Player
2) Floating Chat Window


the problem is when you detach the CD Player, and the Floating Chat Window they only populate one window. So. If I have the chat window open and click detach CD player it opens in the Chat window. And visa versa.. Argh....:sad:


Do you know How I could fix this?


Peace,
Odin

Dani AI

Generated

The behavior described in the thread is almost always the result of popup reuse: browsers treat the second parameter to window.open (and the target attribute on links) as a window identifier. If two pops use the same name, the second load will reuse the first window. Give each popup a unique name or use _blank to force a new tab/window, and keep a reference to windows you want to reuse.

Example patterns to apply:

// always open a fresh popup
function openUnique(url, features) {
  var name = 'popup_' + Date.now();
  var w = window.open(url, name, features || 'width=400,height=300');
  if (w) w.focus();
  return w;
}

// open or focus a single named popup (reuse intentionally)
var myPopup = null;
function openOrFocus(url, name, features) {
  if (myPopup && !myPopup.closed) {
    myPopup.location.href = url;
    myPopup.focus();
  } else {
    myPopup = window.open(url, name, features || 'width=400,height=300');
    if (myPopup) myPopup.focus();
  }
}

Notes and troubleshooting: open calls should be triggered by direct user actions to avoid popup blockers; browser/user settings may open popups as tabs or in background; focus() is not guaranteed across all platforms. For reference on window.open and link targets consult the MDN docs: Window.open (MDN) and the target attribute (MDN). This approach addresses the reuse issue that reported and aligns with ’s observation about windows being sent to the background.

Recommended Answers

All 3 Replies

Both windows opened for me...the first popup window just got sent to the background. You can still access it from the taskbar.

Really? When I open the 2 pop-ups in several browers they populate in the same window... Hmmph. now Im confused. If I may, I will re-announce the issue to make sure.

When I am on the site. I open the "Chat Window" and all is ok... While in the chat window I open the "Detach CD Player" on the bottom and it populates in the "Chat Window"....

Do you experience the same?

Odin

FYI check it out at

I didn't sign up...so the chat window doesn't work for me.

I opened the chat window, and then clicked on the detach radio player link in the main window.

While it appears that one window replaces the other, the first popup window simply gets sent to the background. It is still open.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.