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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:43:07+00:00 2026-05-13T13:43:07+00:00

I have run into a situation where I need to manually remove old dialogs

  • 0

I have run into a situation where I need to manually remove old dialogs before creating new ones. In another thread, the following method was suggested:

$('.ui-dialog').empty().remove();

And I think this would work, but I do have other dialogs that I do not want to remove from the DOM, and I think this method would get rid of all of them. Inspecting the page with Firebug shows that once JQuery creates a dialog out of the html you provide, it gives it standard wrapper divs, all with the same classes. These are:

ui-dialog ui-widget ui-widget-content ui-corner-all  ui-draggable

So they’re pretty generic, and it’s hard to find a unique characteristic about the outer wrapper classes that need to go. I’m trying to find a way to only remove the dialogs that I want to remove, and leave the others. Any ideas?

  • 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-13T13:43:07+00:00Added an answer on May 13, 2026 at 1:43 pm

    SELF-ANSWER:

    So based on Philippe’s answer to my original question I took the following approach, which worked:

    When creating the dialog, usually you’re creating it based on an ID, and once JQuery creates the dialog, that html (with the ID) is still underneath the wrappers. To make sure I was removing the correct dialog, I used JQuery’s has, like this:

    $('.ui-dialog:has(#' + $myDialogDiv.attr('id') + ')').empty().remove();
    

    This first empties the wrapper’s contents, then removes it from the DOM.

    Thanks to Philippe for the ideas.

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

Sidebar

Related Questions

I am working on a Facebook app and have run into a situation where
I am currently in a situation where I have both 32 bit and 64
I need to load large amounts of bitmaps into memory for display in a
I'm creating a web app using Spring 3 and would like to harness the
We have multiple developers working on a project. We're employing a feature-branch method of
I have built a Ruby on Rails (2.3.8) application that allows users to track
From this thread : http://geekswithblogs.net/kaju/archive/2005/12/05/62266.aspx someone asked (in the comments) this question: is there
Background I've written a small C#/.NET 4.0 application that syncs various settings from a
I'm having trouble trying to cast a LPCWSTR to an LPCSTR. Some Background I
I've looked at some other questions, they seem to be unrelated to SQL-Server. Given

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.