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

  • Home
  • SEARCH
  • 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 7814785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:18:26+00:00 2026-06-02T05:18:26+00:00

I have a popup window that must span multiple frames, so I’m using window.createPopup

  • 0

I have a popup window that must span multiple frames, so I’m using window.createPopup to get this to work. (IE6, 7, and 8.)

Below is the function I’m using to create the popup:

function ShowMyPopup() {
    notificationPopup = window.createPopup();
    $(notificationPopup.document.body).load("/notification.html");
    notificationPopup.show($(sourceFrame.document.body).width() - 510, $(sourceFrame.document.body).height() - (510 - $(sourceFrame.document.body).height()), 500, 500, sourceFrame.document.body);
}

This seems to work pretty well. I see the popup window as I should. The problem is, no matter what I do, I can’t seem to access any of the DOM elements in the resulting popup window. I’ve tried various jQuery methods as well as a straight up getElementById, and all return NULL. Below is the contents of notification.html:

<html>
<head>
    <script type="text/javascript">
        $(document).ready(function () {
            alert($(document).html());
            alert($("#divNotification").html());
            alert(document.getElementById("divNotification"));
        });
    </script>
</head>
<body>
    <div id="divNotification" onclick="$(this).toggle();">
        <h3>Some Notification!</h3>
        Testing 1234...
    </div>
</body>
</html>

I see three alerts, so I know that jQuery is working, but all three alerts simply show “NULL”. If I click on the resulting div, the onClick fires but I get an “Object Expected” error.

What is going on here?

  • 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-06-02T05:18:30+00:00Added an answer on June 2, 2026 at 5:18 am

    Ok. I figured this out. It’s pretty counter intuitive.

    Basically, I ended up loading all relevant javascript libraries into the source frame. I then must explicitly reference the source frame by its name in order to access these methods.

    If any javascript – even javascript inside the popup window – wants to access the popup window’s DOM, you must fully qualify it (or provide jQuery will the correct root object) for it to work.

    For instance, here is my new notification.html:

    <div id="divNotification" onclick="top.SourceFrame.MakePopupRed();">
        <h3>Some Notification!</h3>
        Testing 1234...
    </div>
    

    Now, in my source frame’s referenced javascript library:

    function MakePopupRed() {
        if (notificationPopup) {
            $("#divNotification", notificationPopup.document).css("background-color", "red");
        }
    }
    

    So, basically, it appears that javascript that is run inside a popup created from window.createPopup executes in the context of the parent window, rather than the popup window itself!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JInternalFrame window that needs to popup a modal dialog box when
I have a button that opens a panel in a popup window and then
I have a Java swing application with a button that produces a popup window
I'm using ajax requests to populate modal popup windows with data that users have
We have implemented a popup window as a modal dialog using the IE method:
I have a popup window that pops up and I need to have the
I have a popup window code that I have used before in login forms.
I have a click function that has a popup window that I need to
I have a popup window like this, <controls:ChildWindow Background=Aquamarine> <RichTextBox> <Paragraph x:Name=WarningMessage > <Run>Test
I have an application that uses window.open() to generate dynamic popups. Unfortunately, I've had

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.