Manipulate json data with jQuery
HTML
<ul id="groups"></ul>
JavaScript
(function () {
var flickerAPI = "http://byptserver.com/technicianapp/index.php?r=api/getAllCategories";
$.getJSON(flickerAPI, {
tags: "mount rainier",
tagmode: "any",
format: "json"
})
.done(function (data)
{
//alert(data.data[0].category);
//return;
var catId = "0"
var $grouplist = $('#groups');
$.each(data.data, function (i, item)
{
if (item.parent == catId )
{
$('<li>' + item.category +" ("+ item.parent+") "+'</li>').appendTo($grouplist);
//alert(item.category);
}
});
});
})();