What did I manage do do wrong here? I can't see it, through the first $.each it works, get to the second it stops..
var testJSON = {"cluster":[{"node":[{"name":"one", "number":'100', "error":"none"},{"name":"two", "number":'200', "error":"none"},{"name":"three", "number":'300', "error":"found"},{"name":"four", "number":'400', "error":"none"}]}]}
if (testJSON.cluster.length != 0)
{
$.each(testJSON.cluster, function(i, clstr)
{
$('.clusters').append('<ul class="nodes">');
$.each(clstr.node, function(i, ndes)
{
$.find('ul').append('<li>'+ndes.name+'</li>');
});
$('.clusters').append('</ul>');
});
}
append()
is adding a DOM node, not text -append ("</ul>")
seems out of place. – BrokenGlass Aug 17 '11 at 15:15