1

Wondering if anyone can do a quick demo on Jsfiddle to show how it would work to do the following.

Let's say I have a mysql table with columns: product_name, product_price, product_id; I do a mysql select and return the array using an AJAX call. How do I render that on page using Knockout?

I can do the AJAX call and grab the data. It's returned as an object. I use json_encode in the PHP to return the data back in getJSON call.

What do I do next to render it? That's what I am stuck on. I just want to render a table looping product name, product id, and price.

    var allData = $.getJSON("ajax.php?request=getresults", data, function(response) {
        return (response);
    })

Thanks!

Scott Yu - builds stuff
  • 11,673
  • 8
  • 42
  • 55

1 Answers1

0

Oh.. I found an example and it works! loading a knockout.js observableArray() from .ajax() call

http://jsfiddle.net/madcapnmckay/EYueU/

Community
  • 1
  • 1
Scott Yu - builds stuff
  • 11,673
  • 8
  • 42
  • 55