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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:21:50+00:00 2026-05-23T14:21:50+00:00

I am loading an external php page into a jQuery UI Dialog through the

  • 0

I am loading an external php page into a jQuery UI Dialog through the open event like so:

$.ajax({
    url: "page.php",
    success: function(data){ 
        $("#loadDiv").dialog({
            open: function(){
                $(this).html(data);
            },
            autoOpen: false,
            resizable: false,
            minWidth:900,
            minHeight:480,
            modal:true,
            title: "Add Page",
            buttons: {
                "Add": function() {
                    $.post("script.php", $("#addPageForm").serialize() ,
                    function(data){
                        if( data.search("<b>Error</b>") != -1 ||  data.search("<strong>Error</strong>") != -1) {
                            // Error occured 
                        }else{
                            // Success
                        }
                    });
                },
                "Cancel": function(){
                    $(this).dialog("close");
                }
            }
        });
    }
});

(#loadDiv is just an empty div that is hidden on the page)

The problem is that when you click the cancel button, it is supposed to close the dialog – but it doesn’t. I use FireBug for FF and it tells me the error “$(this).dialog is not a function … $(this).dialog(“close”);”. When I try to re-open it with $(“#loadDiv”).dialog(“open”) doesn’t work either and I think the two are related problems.

The problem is that the content of the dialog is being loaded dynamically through ajax, because it works if I take out the ajax part. I need to figure out how to get it to work with the way I am loading the content now.

Any suggestions would be appreciated! Thanks!

  • 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-23T14:21:51+00:00Added an answer on May 23, 2026 at 2:21 pm

    Figured it out, the page that I was putting into the dialog included the jQuery source, so I removed that line and it all works fine.

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

Sidebar

Related Questions

i'm loading, using the JQuery ajax() method, an external page with both html and
I'm trying to call to external PHP script using Ajax like this: $(function() {
After loading a PHP template (using jQuery's load function), this simple script won't make
Im wondering what affect loading an external page with php has on a sites
Loading an external php file with jquery is actually easy. I simply use the
I'm loading an external page into an IFRAME, which contains an advertisment that I
I'm having a problem with loading external pages into a DIV using jQuery. I
I am having issues with loading external javascript using JQuery. Every time when I
I've got a Flash movie, loading data from an external URL. In fact, it's
This is in AS2. I'm loading an external AS2 swf using the loadclip function.

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.