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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:30:33+00:00 2026-05-28T05:30:33+00:00

I am trying to enumerate and build the following fiddle with Mustache.js: $(function ()

  • 0

I am trying to enumerate and build the following fiddle with Mustache.js:

$(function () {
    var choices = { "users": [
        {    "first_name": "Ryan",
            "last_name": "Pays",
            "pic_square": "/Global/profile/thumb/placeholder.jpg",
            "product_name": "Merlin - the complete box set",
            "product_picture": "/Global/products/full/box-set.jpg"
        },
        {    "first_name": "Eric",
            "last_name": "Li Koo",
            "pic_square": "/Global/profile/thumb/placeholder.jpg",
            "product_name": "Merlin - Series 4 volume 1",
            "product_picture": "/Global/products/full/box-set.jpg"
        },
        {    "first_name": "Abdul",
            "last_name": "Raouf",
            "pic_square": "/Global/profile/thumb/placeholder.jpg",    
            "product_name": "Merlin - the complete box set",
            "product_picture": "/Global/products/full/box-set.jpg"
        }]
    };
    $.getJSON("http://jsfiddle.net/echo/jsonp/?callback=?", choices, function (data) {
        console.log(data);
        var template = "<ul>{{#users}}" +
                        "<li>" +
            "<p><strong>{{first_name}} {{last_name}}</strong> likes {{product_name}}</p>" +
                        "</li>" +
                        "{{/users}}</ul>",
            html = Mustache.to_html(template, data);
        $('.wrapper').html(html);
    });
});

Example here -> http://jsfiddle.net/mhMJA/3/

It correctly logs the JSON response to the console but then seems to be failing to build the template. If i just pass a single user to the JSONP callback it works fine.

Thanks in advance.

  • 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-28T05:30:33+00:00Added an answer on May 28, 2026 at 5:30 am

    It’s not your fault. It’s jsfiddle helps you convert your JSON object to the following format.

    {"users[0][first_name]":"Ryan","users[1][first_name]":"Eric","users[2][first_name]":"Abdul","users[2][product_picture]":"/Global/products/full/box-set.jpg","users[1][product_picture]":"/Global/products/full/box-set.jpg","users[1][pic_square]":"/Global/profile/thumb/placeholder.jpg","users[1][product_name]":"Merlin - Series 4 volume 1","users[0][last_name]":"Pays","users[0][product_picture]":"/Global/products/full/box-set.jpg","users[1][last_name]":"Li Koo","users[0][product_name]":"Merlin - the complete box set","users[0][pic_square]":"/Global/profile/thumb/placeholder.jpg","users[2][last_name]":"Raouf","users[2][pic_square]":"/Global/profile/thumb/placeholder.jpg","users[2][product_name]":"Merlin - the complete box set","_":"1326530878282"}
    

    I suggest you write your own JSONP app to avoid this issue. Here is I used JSON2 to get the JSON object out.

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

Sidebar

Related Questions

Consider the following graph: I'm trying to find a way to enumerate all possible
I was developing a small function when trying to run an enumerator across a
I'm trying to build a utility method using Linq that will help me with
I'm trying to enumerate all hosts in an XML document, create a db entry
I'm trying to enumerate through all the Controls of a Page, but all I
I'm trying to enumerate all the permissions used by all the installed packages, however
I'm trying to enumerate, in c#, the reports for a user on reporting services.
I am trying to enumerate all the namespaces in a document using XPath. The
I am new to phing and trying to verify if my build.xml works as
I'm trying to enumerate some operators, my code line is : enum operations{+=4,-,%,<,>} when

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.