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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:14:13+00:00 2026-06-12T14:14:13+00:00

I never had problems to make anything from json to html and so on.

  • 0

I never had problems to make anything from json to html and so on. I saw to many libraries for ajax html templating but i never found an answer why i should use.

Maybe the main answer is code visibility and maintenance? What about speed or any other reason ?

This is how i design html from json:

function MakeRow(item, alt) {    

    var html = "<div class='item "+alt+"'>";
    html += "<div class='checkbox'><input type='checkbox' name='checkedRecords' value='" + item.ID + "' /></div>";
    html += "<div class='attach'><img src='" + item.Attach + "' /></div>";
    html += "<div class='from'>"+item.From+"</div>";
    html += "<div class='title'>"+item.Title+"</div>";
    html += "<div class='date'>"+item.Date+"</div></div>";
    return html;
}
  • 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-12T14:14:15+00:00Added an answer on June 12, 2026 at 2:14 pm

    Templating is a way to manage separation of concerns. The basic idea is that your HTML should be concerned with the structure of the document, and your javascript is concerned with updating the data presented by the document.

    By using templating the HTML doesn’t have to know anything about the data beyond the names of the properties the template is bound to, and the Javascript doesn’t have to know anything about the structure of how the data is to be presented. The Javascript just retrieves the data from wherever and then popultaes the template defined in the HTML with the appropriate values.

    The approach in your question work, obviously, but the problem is that if you want to change the layout of your page you potentially have to trawl through your Javascript and modify all this code. With templating, all of layout is where it should be – in the HTML – so you can modify the layout as you want and it should all just work, within limits of course.

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

Sidebar

Related Questions

I never had any problems with Delete button on any browsers, but I had
I never had problems with any of my projects. Just recently when I ran
I've never had problems with references as in Python (implicit) or PHP (explicit &).
Usually I worked with PostgreSQL and never had a problem, but now I need
I've never had to do this, but I'm binding a repeater to a generic
Had a idea and now trying to make it happen. Idea: Have a HTML
I am using core data for my app and I never had any problems
I've tried searching for people with similar questions, but haven't found anything. I have
I've never had so much trouble writing data to files! I'm running GCC from
For years, on 32-bit systems I have never had a problem. Why can't I

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.