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 725565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:21:05+00:00 2026-05-14T06:21:05+00:00

Here’s my scenario: I’ve got a div on Page A. When an event happens

  • 0

Here’s my scenario:

  1. I’ve got a div on Page A.
  2. When an event happens (whatever I define, a click, whatever), I do a div.Dialog, set its properties and open it
  3. The data inside is returned from an async .ajax call that grabs the data from a url and appends it to the div by calling div.html(data) inside the .ajax callback, so it’s essentially loading a PageB by getting the data (content) and appending it to the div that’s calling the dialog(“open”)…nothing special here I don’t think.

My question: In Page B, how do I reference the dialog so I can do some things to it? For instance in Page B’s content that I received back from that .ajax call and added to the div via .html(data), there is a button and when clicked I need to close the dialog.

Right now my buttons are not working inside the dialog because one of them closes out the dialog and the other should redirect to a new page but both do not work now because I have no reference to the dialog that it’s in to manipulate it. So I need reference so I can close the dialog via some jQuery that will reside in PageB (data).

  • 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-14T06:21:06+00:00Added an answer on May 14, 2026 at 6:21 am

    If Page B is loaded by AJAX (as opposed to an <iframe>), any Javascript in it will run in the same context as the rest of Page A.

    Therefore, you can use the same code you use in Page A to reference the dialog in Page B.
    Note that if Page B is also used elsewhere, you’ll need to check that you’re actually running inside of Page A first. (Check whether the dialog exists, or some variable set in Page A)


    EDIT

    If it is in an <iframe>, you can interact with the parent frame using the parent property.

    Specifically, you can run jQuery code in the context of the parent frame using parent.$.
    For example:

    parent.$('#someId').dialog(...);
    

    Since this uses the $ function from the parent page, Page B does not need to reference jQuery or jQuery UI. The selectors would be matched within the parent page.

    You could (but shouldn’t) run the parent page’s jQuery code against the child page by writing parent.$('selector', document)

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

Sidebar

Related Questions

Here Scenario is HttpContext.Current.Session[value].ToString() gives null value, even have already set session value when
Here is the scenario. I'm writing my geo-ruby oracle adapter for Ruby On Rails
Basically, what I'm trying to create is a page of div tags, each has
Here is my program to find all the subsets of given set. To solve
Here is my code (Say we have a single button on the page that
Here is my question. I am having this simple menu. <div id=menu> <ul> <li>
Here's my scenario - I have an SSIS job that depends on another prior
Here is the scenario: I'm writing an app that will watch for any changes
Here is my code <!doctype html> <html> <head> <meta charset=utf-8> <script src=js/jquery-1.7.2.min.js></script> <style> div{
Here is my AJAX call: $(document).ready(function () { $(#btnSignup).click(function () { $.ajax({ type: POST,

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.