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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:44:01+00:00 2026-05-24T10:44:01+00:00

I am using JQuery and Jquery UI to create a dialog box which contains

  • 0

I am using JQuery and Jquery UI to create a dialog box which contains a custom form. I have a basic dialog frame, which has a tool appended to its body. So the basic structure of my dialog is Jquery UI Frame > Dialog Frame > ToolBody > Tool Content.

Code: 

ToolManager.prototype.showTool = function(tool){
    var $container = $("#" + this.id);
    var $tool = $("#" + tool.id);
    var $toolBody = $("#" + this.toolBodyId);

    $container.dialog({
        resizable: false,
        modal: true,
        width: tool.width,
        stack: true,
        height: 'auto',
        draggable: true,
        close: this.tearDown,
        open: this.setup
    });

    $tool.removeClass("hidden");
    $toolBody.append($tool.html());
    //$toolBody.append($tool);
    $container.show();
};

This works despite its need for refactoring, however before using this method I was attempting to use the commented out line:

 $toolBody.append($tool);

This method wreaked havoc on my layout and caused the appended content to be blocked from receiving focus. Can anyone explain the difference between appending a Jquery Object and appending an html string? Or why it behaved this way?

  • 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-24T10:44:02+00:00Added an answer on May 24, 2026 at 10:44 am

    This line of code:

    $toolBody.append($tool);
    

    Will take the nodes in $tool, and move them to the first (hopefully, the only) node of $toolBody.

    This line of code:

    $toolBody.append($tool.html());
    

    Turns all of the HTML code inside of $tool and turns it into a string. The jQuery Append method has sugar around it and is smart enough to realize that when you’re attempting to append() a string, it should first turn that string into a set of nodes.

    Effectively, you’re moving the nodes in the former and case and doing a (poor) clone of the nodes inside of $tool in the latter case.

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

Sidebar

Related Questions

Morning. I have a form which is rendered inside of a jquery dialog box
How do I create an edit dialog box using jquery? Let say I have
I am using ASP.Net MVC along with Jquery to create a page which contains
I have created app using jQuery Mobile and need to get a Dialog box
Here is what I have..I am using the jquery.FrameDialog plugin. When the dialog box
I want to create Dialog box which can show form where i can refresh
I'm using the following code to create a Dialog box using JQUERY/UI: var $dialog2
I created a page that has a JQuery based dialog using the standard JQuery
I am using jquery to create a custom dropdown with the code below. I
I am using jQuery to create a dialog that should show up in the

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.