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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:56:23+00:00 2026-05-25T02:56:23+00:00

In some case, I need to copy from a node template and fill some

  • 0

In some case, I need to copy from a node template and fill some fields of the node with json data. How can I do that? For example in HTML file I have written such a template:

<div id="template" style="display:none">
    <h1>{{name}}</h1>
    <p>{{content}}</p>
</div>

and my json data is

[{"name":"A","content":"B"},{"name":"C","content":"D"},{"name":"E","content":"F"}]

and I want to generate three nodes and append them to the document.

Also, the

node maybe binded with some click event and I want the new node actions too.

  • 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-25T02:56:23+00:00Added an answer on May 25, 2026 at 2:56 am

    You’d be best off using a templating library – my favourite is jQuery.tmpl but there are others.

    You’d have to modify your template like so:

    <script id='template' type='text/x-jquery-tmpl'>
      <h1>${name}</h1>
      <p>${content}</p>
    </script>
    

    then render it like this:

    $('#template').tmpl(data).appendTo('body');
    

    where data is your array. This will create a separate template instance for each member of the array.

    For a quick guide to jQuery.tmpl have a look at my slides or my presentation.

    If you want to bind events, either bind them after you’ve added the rendered template to the DOM, or use live or delegate.

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

Sidebar

Related Questions

Some high risk data operations need to be logged. In this case, the high
I have a case where I need to update a jqgrid based on some
We need to identify and then process switch/case statements in code based on some
This is a minimal test case of some code that I actually have. It
I have some SQL that does an order by case statement. It works fine.
I have some code that looks like this: someFunc(value) { switch(value){ case 1: case
I am migrating data from a Oracle on VMS that accesses data on SQL
I am trying to figure out how can I copy DispatcherObject (in my case
The use case is some what like this: public class SomeClass : ICloneable {
My basic use case is do some processing, set flash[:notice] , and then redirect

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.