Skip to content

Instantly share code, notes, and snippets.

@Marak
Created March 3, 2010 22:36
Show Gist options
  • Save Marak/321120 to your computer and use it in GitHub Desktop.
Save Marak/321120 to your computer and use it in GitHub Desktop.
Tree.build = function(data){
var str='<ul>';
for(var key in data){
if(typeof data[key]=='object' && data[key]!=null){
str+='<li>'+key+Tree.build(data[key])+'</li>';
}
else
{
str+='<li><strong>'+key+'</strong> : '+data[key]+'</li>';
}
}
str+='</ul>';
return str;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment