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

  • Home
  • SEARCH
  • 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 7903865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:51:22+00:00 2026-06-03T09:51:22+00:00

Below is the prototype of what I am trying to do. var entry_set =

  • 0

Below is the prototype of what I am trying to do.

var entry_set   = $;

// start to loop data
for([])
{
    // create HTML element to represent that data
    $('<div></div>')
        .data([])
        .addClass([])
        .on([])
        .insertAfter(entry_set);
}

// modify DOM only once all the entries are consolidated to a single jQuery object
entry_set.appendTo('.entries');

The comments say it all. In short – the idea is to modify document DOM only once when inserting data. I would usually go HTML string approach (simply concatenating the same structure using a string), but I am interested whether anything similar to this might work as well.

  • 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-06-03T09:51:23+00:00Added an answer on June 3, 2026 at 9:51 am

    You could create an empty DOM element and .append() to that

    var entry_set = $("<div>"); //empty dom element
    
    // start to loop data
    var i = 4;
    while(i--) {
        // create HTML element to represent that data
        var item = $('<div>', {
            text: "test " + i
        });
        entry_set.append(item);
    }
    
    // modify DOM only once all the entries are consolidated to a single jQuery object
    $("body").append(entry_set.children());​
    

    working demo at: http://jsfiddle.net/F2J6g/1/

    EDIT
    You can also start with an empty collection and use .add()

    var entry_set = $(); //empty collection
    
    // start to loop data
    var i = 4;
    while(i--) {
        // create HTML element to represent that data
        var item = $('<div>', {
            text: "test " + i
        });
        entry_set = entry_set.add(item);
    }
    
    // modify DOM only once all the entries are consolidated to a single jQuery object
    $("body").append(entry_set);
    

    http://jsfiddle.net/F2J6g/2/

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

Sidebar

Related Questions

In the code below, I am trying to create a function patient_count that is
I'm trying to use prototype and scriptaculous to hide and display a div element
I've been trying to create a simple prototype web application that uses RestSharp to
I'm trying to use prototype inheritance in Javascript. The problem with my code below
So I am trying to create an extension in Chrome (a prototype for a
I am trying to create a regular expression with a character class that has
In the code below when the anchor element is clicked I am trying to
im trying to use html and javascript to create a rotating logo on my
In the code below: DbModels.prototype.updateById = function(_collection, id, field, value, callback) { this.getCollection(_collection, function(error,
I have the below prog Object.prototype.inherit = function(baseConstructor) { this.prototype = (baseConstructor.prototype); this.prototype.constructor =

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.