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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:22:59+00:00 2026-05-24T09:22:59+00:00

Here is the issue, i am running a complete ajax webapp with jquery plugins

  • 0

Here is the issue, i am running a complete ajax webapp with jquery plugins but i am having trouble reinitializing once i close the dialog.

function edit()
{
$("#dialog").dialog({
    modal: true,
    resizable: false,
    autoOpen: false,
    buttons: {
        'Save' : function(){
                // Some function here.
        },
        'Close' : function(){
            $("#dialog").dialog('destroy');
        }
    }
});
}

The dialog is invoked by a button and all it does is call the above function edit()

I have tried these methods:

Scenario 1:

I click the button do the edit and in between i decide to close the popup using the close button (not the x button on top), the dialog closes.When i click the button again the dialog opens but now when i try to close i have to click twice because two instances of dialog are running apparently.

Scenario 2:

When i figured out that to avoid two instances i have to use

$("#dialog").dialog('close').remove(); 

instead of

$("#dialog").dialog('close');

This solved the multiple instance issue but now i can’t open the dialog unless i refresh the page, any ideas on how to solve?

  • 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-24T09:23:00+00:00Added an answer on May 24, 2026 at 9:23 am

    In this you remove the element with the id dialog:

    $("#dialog").dialog('close').remove(); 
    

    You should make sure in your edit function that #dialog exists before you call .dialog() on it. For example:

    if( ! $('#dialog').length ) {
         $('body').append('<div id="dialog"></div>');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having an issue here that I have tried everything I can think of but
Im having a weird issue here. Its probably just something stupid but I dont
I'm running into an issue with a jquery ajax function not properly returning its
I used Homebrew to do all my installs but am having some trouble here...
I am running into an issue similar to the one described here: NSFetchedResultsControllerDelegate not
I am running into an issue with the way my asynctasks are executed. Here's
I'm running into an odd issue with itemRenderers inside a TileList. Here is a
I am somewhat new to PHP and am running into an issue. Here is
My issue here is quite simple : i'm trying to use the jQuery validate
I'm having a small issue here: <div id=navbar> <ul id=navtabs class=floatcontainer> <li <?php if

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.