try{ var jsonStr='{}'; jsonObj=JSON.parse(jsonStr); var htmlObj ={}; var objectId =0; var level=0; var htmlStr="" htmlStr += ""; htmlStr += ""; htmlStr += ""; htmlStr += ""; htmlStr += ""; htmlStr += "
\n\n"; printObjectValues(jsonObj,null,level); htmlStr += "\n
\n
"; //var pattern = new RegExp("\\n","g"); //htmlstr =htmlStr.replace(pattern,''); htmlStr += ""; //console.log(htmlStr); function tabs(level){ return ''; } function tabsOrig(level){ var tabs=""; for(var i=0;i" + printValue(o) + "\n"; } } }catch(err){ console.log(err); } return output; } function printValue(obj){ if(obj != undefined){ if(typeof obj == 'string'){ return "'" + obj + "'"; }else{ return obj; } }else{ return ""; } }