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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:50:54+00:00 2026-06-01T16:50:54+00:00

I am attempting to present a JSON collection, which is retrieved asynchronously and using

  • 0

I am attempting to present a JSON collection, which is retrieved asynchronously and using FireBug I can see this ultimately looks like:

[{"Id":"00000010"},{"Id":"00000002"},{"Id":"00000003"}]

This does not work, but if I declare a collection as:

[{ "Id": "00000004" }, { "Id": "00000005" }, { "Id": "00000006"}]

This works, and then using FireBug I can see this is slightly different:

[Object { Id="00000004"}, Object { Id="00000005"}, Object { Id="00000006"}]

Why does it make a difference when retrieving the data synchronously and declaring a collection? What are my options for getting this to work.

Thanks.

UPDATE

I am also using sammy.js, here is the JavaScript:

var app = $.sammy('div[role="main"]', function () {

    this.use('Mustache', 'html');

    this.get('#/', function (context) {
        this.load('/data')
            .then(function (response) {

                context.blah = 'blah';
                context.data = response;

                var data2 = [{ "Id": "00000004" }, { "Id": "00000005" }, { "Id": "00000006"}];
                context.data2 = data2;

                var templateUrl = '@Url.Content("~/Templates/template.html")';

                context.partial(templateUrl);
            });
    });
});

$(function () {
    app.run('#/');
});

Here is the template:

<h1>{{blah}}</h1>
<ul>
{{#data}}
<li>{{Id}}</li>
{{/data}}
</ul>
<ul>
{{#data2}}
<li>{{Id}}</li>
{{/data2}}
</ul>
  • 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-01T16:50:55+00:00Added an answer on June 1, 2026 at 4:50 pm

    Okay, I figured this one out!

    context.data = response;
    

    becomes

    context.data = JSON.parse(response);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings, I am attempting to remove multiple documents from a MongoDB collection using the
I'm attempting to upload a file asynchronously using HTTP POST and jQuery, but I'm
Background : Applications that manipulate a collection of data typically present using a grid
I am attempting to prevent the deletion of a Row for my GridView like
I am attempting to prevent default anchor behavior in Safari using the jQuery library.
I am attempting to make a program in C which presents a GUI and
Attempting to use the data series from this example no longer passes the JSONLint
Attempting to build a C# project which has numerous references to assemblies in NuGet
I am attempting to run my rails app using Passenger and Apache. As far
I'm attempting to read a property on a series of Sprites. This property may

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.