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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:19:02+00:00 2026-06-13T13:19:02+00:00

I have this basic knockout script set up (still learning) $.getJSON(clientUrl + /list/ +

  • 0

I have this basic knockout script set up (still learning)

$.getJSON(clientUrl + "/list/" + 1, function (data) {

var viewModel = {
    clients: ko.observableArray(data)
};

ko.applyBindings(viewModel);
});

The first argument ‘lucidServer.getClients(1)’ makes a call to this ajax request:

var getClients = function (id) {
    return $.ajax(clientUrl + "/list/" + id)
};

Now I am getting the json back, but it does not seem to be binding correctly the the template. Here is the json:

0: {iD:1, userId:1, name:CompanySoft, LLC.,…}
1: {iD:2, userId:1, name:Widget Factory,…}
2: {iD:3, userId:1, name:Jim's Consulting,…}

ANd the template is here:

<div id="clientListOutput">
            <ul "template: { foreach: clients }">
                <li><span data-bind"text: name"></span></li>
            </ul>
        </div>
  • 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-13T13:19:03+00:00Added an answer on June 13, 2026 at 1:19 pm

    You have a lot of typos in your markup.

    The HTML should look like:

      <div id="clientListOutput">
                <ul data-bind="foreach: clients">
                    <li><span data-bind="text: name"></span></li>
                </ul>
      </div>
    

    As you have markup inside your ul tags you don’t need to use the template binding. Just use a foreach and Knockout will do the work to iterate over each client and render the li for each one.

    Here is a working fiddle: http://jsfiddle.net/jearles/6XhM4/

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

Sidebar

Related Questions

Hi I have this basic random quote script, but I would like it to
I have this basic function for handling the key event, everything works great. However,
I have this basic javascript code: window.resizeTo(1000,800) set to run when the page loads
I have this basic script that makes an element show onmouseenter, and hide onmouseleave.
Say I have this basic setup: #include <list> struct Linker { Linker* to; //some
So I have this basic script: /*check if email is valid*/ if (substr_compare (
The Javascript timer event has this basic syntax: var t=setTimeout(javascript statement,milliseconds); I have this
I have a basic table set up using knockout, but I was wondering if
I have this basic Linked List structure: struct node { char *name; float salary;
I have this basic shopping list app where in the first view there are

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.