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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:02:54+00:00 2026-05-30T18:02:54+00:00

Using knockout’s mapping plugin, how would I go about displaying the information from and

  • 0

Using knockout’s mapping plugin, how would I go about displaying the information from and array of JSON object’s in my template.?

//Example JSON data.
JSON = [{'title':'title of first object', 
         'content':'content of first json object'}, 
         {'title':'title of second object', 'content': 'content of second json object'}]

var viewModel = ko.mapping.fromJS(data);

var data = $.getJSON('/post/.json', function(data) {
    ko.mapping.fromJS(data, viewModel);
});

I’m able to access the objects via viewModel() and viewModel()[0].title() using Console in Chrome but not sure how to bind this date to my template.

  • 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-30T18:02:57+00:00Added an answer on May 30, 2026 at 6:02 pm

    After you receive your data, you would need to call ko.applyBindings(viewModel).

    In your HTML, you can bind against your data like:

    <ul data-bind="foreach: $data">
         <li>
              <span data-bind="text: title"></span>: 
              <span data-bind="text: content"></span>
         </li>
    </ul>
    

    Here is a sample: http://jsfiddle.net/rniemeyer/YkT6p/

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

Sidebar

Related Questions

We are using knockout and the knockout mapping plugin to facilitate databinding in our
I am using Knockout and the Knockout Mapping plugin. My MVC3 Action returns a
Does anyone know of an example application using knockout js and MVC 2? I'm
Using knockout.js, is it possible to bind to a property of a child object
I'm using Knockout with jQuery and jQuery templates. Assume that I have a template
I am binding a list of objects to a select using knockout. Object Class
I'm fetching JSON from my ASP .NET website using the following jQuery: $.ajax({ type:
I'm having a problem mapping a JSON array generated by .NET JavaScriptSerializer , to
I am using knockout with jquery template, I am stuck in a place in
I am trying to delete an item from a list. I am using knockout.js

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.