Consider creating the node as an element before inserting it, as then you have a reference to it and can skip the later lookup. Something like:
$.getJSON("/data/all" , function(data){
nodes = data;
len = nodes.length;
for(i=0; i<len; i++){
if(i==0){
// works on FF && Chrome
var newNode = $('<li id="node-'+ nodes[i].id +'"><input type="checkbox" name="">'+ nodes[i].name);
$('ul#root').append(newNode);
// works on FF only
newNode.append('<ul id="' + nodes[i].id +'>');
}
else{
...
...
}