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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:00:59+00:00 2026-06-18T00:00:59+00:00

I encoded the response from the database in json, getting a json with this

  • 0

I encoded the response from the database in json, getting a json with this structure that I sent with echo from a controller with json_encode ( I work in php):

[
{column1: value, column2: value...}            //row 1
{column1: value, column2: value...}            //row 2
....                                           //row n
]

My script (my template in handlebar) is:

<script id="handlebars_deals_list" type="text/x-handlebars-template">
    {{#each data}}
        {{tittle}}
    {{/each}}
</script>

I passed the context in this way:

var source=jQuery('#handlebars_deals_list').html(); 
var template = Handlebars.compile(source);
var context={data:response};//response is the json data I showed earlier
console.log(context); //Object{data="\n[{"id":"149417","biz_n......null,"index_deal":"0"}]"}
var html=template(context);
console.log(html); //empty!!?!?!?!!?!?!?!?!, why????

But I dont see any template rendered

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

    after fighting a little with this issue I had the solution:

    function process_deals_date(response){
        var response=jQuery.parseJSON(response); //THIS IS THE KEY
        var source=jQuery('#my_template').html(); 
        var template = Handlebars.compile(source);
        Var html=template(response);            
        console.log(html);      //RIGHT POPULATED THE TEMPLATE
    

    }

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

Sidebar

Related Questions

I'm having trouble parsing a json response. Its created via php and sent back
Background: Using jQuery 1.7 client side PHP server side Using json responses with json_encode
I have a text encoded from php with an ajax function with de php
I have a RPC encoded PHP webservice that returns a simple soap envelope with
I create php file to get all task from database but when I enter
Edit This is the function where I get the response from $(document).ready(function() { $.ajax({
I need to get some data from a mysql database.I'm running a php script
I am trying to use json_encode() in a while loop while getting database results.
I've got an android application that is supposed to read a mysql database from
I am using httpwebrequest to get a response from a website. In this response

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.