Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 907685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:35:35+00:00 2026-05-15T16:35:35+00:00

I am launching a popup window with window.open(…) and I pass an elementId to

  • 0

I am launching a popup window with window.open(…) and I pass an elementId to the new popup window.

Then during startup of the popup window I find the element in the opener window that matches the elementId passed to the popup. Then the popup subscribes to events on that element using jQuery.bind(…). Then from inside the opener window I fire these events using jQuery.trigger(…), I also tried triggerHandlers.

The problem is that my popup’s eventHandlers never get called. I can subscribe to the events from within inside the opener window no problem. However, when I try from the popup, it doesn’t work.

Does anyone have any ideas on how to fix this? Is this some kind of security description?

Thanks a lot for reading!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:35:36+00:00Added an answer on May 15, 2026 at 4:35 pm

    OK, when I find the “opener” page element and assign handlers this way:

    // in the popup page
    $(function() {
      var openerElement = window.opener.document.getElementById(theElementId);
      $(openerElement).click(function() {
        alert("Hello World!");
      });
    });
    

    Then, to my surprise, native “real” events work just fine. However, custom events fired from the opener page do not get picked up by the popup page. That sort of makes sense, as each page has its own little jQuery universe. I was apparently wrong however about the browser not propagating native events, so thanks for today’s learning experience!!

    more info — From the popup window (and similarly from any child <iframe> of the main document), you can also use

    var thing_in_main_window = window.opener.$('#thingId');
    

    to find stuff in the opener window. However, simply using the jQuery object in the popup page to find that element cannot work, because jQuery will not traverse the “window.opener” link and go hunting for the element there. When you call $('#thingId') on the popup page, jQuery is just going to called document.getElementById('thingId') using the document object for the popup page. If there’s no element called “thingId” on that page, it won’t be found.

    original answer:

    I don’t think that what you’re trying to do will work. The browser is not going to trigger any event handlers in a window different from the one containing the target element.

    You can, however, catch the event in one window and then trigger a custom event in the other window. When you do that, you’re probably going to want to trigger the event through the jQuery object on that page. In other words, you’d do this:

    $('#thing').click(function() {
      otherWindow.jQuery.trigger("thing-clicked");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm launching a new window with a nib file as below: Workbench* workbench =
After launching an application using the Process class I'd like to make that window
I have a div that I want to write to a popup window (for
We are launching a site that is media heavy and looking at using silverlight,
I noticed that the launching of Java applets using deployJava.js seems to have stopped
I'm using Fancybox to display a popup window, set as type: 'ajax' so I
Am using nsis for launching my java application. I wanted to show a window
Launching your app automatically immediately after install is suprisingly tricky. The advice that's out
I am trying this code to popup the alarm message. Its working when launching
From my C# app I'm launching annother app, which before execution sometimes show dialog/popup

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.