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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:39:33+00:00 2026-06-13T00:39:33+00:00

Using ajax and jQuery Append() to put some items into a div which is

  • 0

Using ajax and jQuery Append() to put some items into a div which is all working well. My question is can I set up some sort to template for the div instead of having to put all the html code in the Append() line?

  • 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-13T00:39:35+00:00Added an answer on June 13, 2026 at 12:39 am

    Have a look at jQuery templates. It seems like it does what you need.

    http://api.jquery.com/template-tag-each/

    See the examples in that page. I think what you are looking for is something like this

    <!DOCTYPE html>
    <html>
    <head>
      <script src="http://code.jquery.com/jquery-latest.min.js"></script>
      <script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js">
    </script>
    </head>
    <body>
    
    <script id="movieTemplate" type="text/x-jquery-tmpl"> 
        <li>
            Title: ${Name}.
            {{each Languages}}
                ${$index + 1}: <em>${$value}. </em>
            {{/each}}
        </li>
    </script>
    
    <ul id="movieList"></ul>
    
    <script>
    var movies = [
        { Name: "Meet Joe Black", Languages: ["French"] },
        { Name: "The Mighty", Languages: [] },
        { Name: "City Hunter", Languages: ["Mandarin", "Cantonese"] }
    ];
    
    /* Render the template with the movies data */
    $( "#movieTemplate" ).tmpl( movies )
        .appendTo( "#movieList" );
    </script>
    
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Jquery Ajax Form to upload files, which works well in Chrome and
Quick question: I'm using jquery ajax to call a page that returns some json
I am working on a filter functionality using ajax/jquery and php/mysql.I have two sets
So I'm using jQuery's AJAX function to read some XML for me and it's
I am using $.post() to input some data into a server. Within the ajax
I'm using Jquery and Ajax function to get data from MySql and put it
I'm having some big problems with encoding in Firefox when using AJAX and jQuery.
I am using ajax jquery to send data to php, as data I am
I have started using ajax/jQuery in our websites / application. There are many plugins
I want to do the search using ajax jquery js, for that I have

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.