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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:00:39+00:00 2026-06-03T23:00:39+00:00

There is a page showing a list of objects (e.g. books). This list can

  • 0

There is a page showing a list of objects (e.g. books).
This list can programmatically increase through client-side interaction.
Which is a good way to create new “books” in the DOM?

I’d like to create an invisible stub of the object in the DOM and then clone it n-times, each time editing proprieties (e.g. like book’s title and thumb).

Which is the best practice?

Performance are not the main focus. Code manutenibility and simplicity is my focus.
I already use jQuery.

  • 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-03T23:00:40+00:00Added an answer on June 3, 2026 at 11:00 pm

    Avoid “clones” and use a client-side templating solution like Mustache or Handlebars. Load your templates (preloaded in variables, via AJAX, whatever), cache them (in objects, arrays, variables, whatever) for reuse then build them via jQuery:

    //the data
    var data = {
        text : 'foo'
    }
    
    //HTML template string
    var templateString = '<div><span>{{text}}</span></div>';
    
    //render contents to template
    var templateWithData = Mustache.render(templateString,data);
    
    //build using jQuery
    //should now be a div that has a span that contains foo
    var newElement = $(templateWithData); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On this page there is a list of footer links that have a little
On my site there is a page where a user can see a list
in my page there are few hidden field which are filled with the correct
Is there a page similar to JSbin where I can test HTML and CSS
I'm loading a page in an iframe colorbox. On this page there's a form
I've got this flow on an enterprise application: on every service page there is
I got the requirement like, In a page there will be 4 panels which
I have a telerik radgrid-control on my page for showing a list of articles.
Is there an efficient way to page through results from a SOQL query without
I have a JSP page (page1.jsp) showing a data table. There are also buttons

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.