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

The Archive Base Latest Questions

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

On my main page I have a sort of side panel that can be

  • 0

On my main page I have a sort of side panel that can be opened and closed. The side panel is loaded via jQuery’s load function into a div on the main page.

Part of the content that is loaded into this side panel is a div(myDialog)

When a button is clicked on in this side panel I call:

$("#myDialog").dialog({
  title : "Permission",
  width : 300,
  height : 200,
  modal : true
});

Now if I close the side panel and clear its contents with jQuery’s empty function. Then I select all and ‘view source’ the html that jQuery added at the bottom of the body is still there. This causes problems when I reopen the side panel and try to open the same dialog because there are two of that div(with duplicate IDs).

I have tried adding this but it doesn’t work:

close : function(){
    $("#myDialog").dialog("destroy");
}

How can I clear that html that jQuery adds to the bottom of the body? Or is there a better way to do what I am trying to do?

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

    jQueryUI actually moves the div elsewhere in the DOM when a dialog is created, thus moving it out from its original container. So, if you tried to call empty() on its original container it wouldn’t work.

    You should remove the dialog div when the side panel is closed, not when the dialog is closed (what if the dialog was never opened).

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

Sidebar

Related Questions

I have a main page that I want to be a sort of dispatch
On my main page I have this jquery code which does an ajax call
I have a main page from where I am making a call to load
I have a index.php page that is the main page. All pages are included
I have a number of iframes calling a function in my main page. Is
I have a main page that has a children item. Now my question is,
I have a web app, that consumes a web service. The main page runs
I'm trying to do blog application and I want main page to have this
I have in the main page with two principal parts : in the left
I have a page (main.php) which loads content from an external PHP file (rpc.php).

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.