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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:44:33+00:00 2026-05-31T05:44:33+00:00

I am still trying to create a full DOM document from a string. I

  • 0

I am still trying to create a full DOM document from a string. I got a bunch of interesting suggestions on this other question, but none actually fits what I’m looking for. So I’m trying to understand how things work to maybe find a solution.

We need to replace a lot of JQuery code with ‘native’ Javascript. With Jquery, we are able to do $('<html><head>...</head><body>...</body></html>') and then perform operations on the nodes of this object, search them… etc.

What does Jquery do? Does it create a new document? Append to the existing one?

Since a lot of people question our replacement of Jquery, here is a little more details: we are building a chrome application which will make use of content script. Even if Jquery is lightweight, it’s not very kind of us to add a couple MB of memory consumed in each tab for a very few Jquery methods. Jquery is awesome and fits many many needs, not ours.

  • 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-31T05:44:34+00:00Added an answer on May 31, 2026 at 5:44 am

    You can find your answer in the jQuery source. You start out with core.js, where you’ll find the init method. If you follow the logic there, you’ll see that for any nontrivial elements it’ll call jQuery.buildFragment, which indeed builds a DocumentFragment which it’ll populate with the content you specified. That will teach you how to deal with building a DOM tree from a string, including stripping out various bits of content that you most likely won’t want.

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

Sidebar

Related Questions

I am trying to create a full-screen preview like this Themeforest link has, What
I am trying to create a Linux application - a screensaver, in this case
I bet this is a simple question. Im trying to style my xml file
I'm trying to create a simple full screen site where the side bar is
Inspired by this question I decided to test the rank() function, trying to see
I'm trying to create a custom tweet button with a popup, this part works.
still trying to find where i would use the yield keyword in a real
I'm still trying to decide whether my (home) project should use UTF-8 strings (implemented
I'm still trying to get my head around LINQ and accessing a SQL Database.
I'm still trying to get my head around using Java's generics. I have no

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.