Gaining Reference to the Dialog from Dialog content

Posted by coffeeaddict on Stack Overflow See other posts from Stack Overflow or by coffeeaddict
Published on 2010-04-14T21:16:49Z Indexed on 2010/04/14 21:23 UTC
Read the original article Hit count: 147

Filed under:
|

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 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.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about ASP.NET