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";
console.log("");
printObjectValues(jsonObj,null,level);
console.log("
");
htmlStr += "\n
\n
";
//var pattern = new RegExp("\\n","g");
//htmlstr =htmlStr.replace(pattern,'');
htmlStr += "";
//console.log(htmlStr);
//console.dir(htmlObj);
var keyObj={};
for (var key in htmlObj) {
var idx = key.lastIndexOf(".");
if(idx != -1){
var str = key.substr(0,idx);
keyObj[str] ='';
}else{
keyObj[key] ='';
}
//console.log(str);
}
console.dir(keyObj);
console.log("");
for (var key in keyObj) {
console.log("- " + key + "
");
}
console.log("
");
function tabs(level){
return '';
}
function tabsOrig(level){
var tabs="";
for(var i=0;i" + pkey + "." + key + " | " +printValue(v) + " | " );
htmlObj[pkey + "." + key ] = printValue(v);
}else{
//console.log( key + ":" +printValue(v) );
console.log("" + key + " | " +printValue(v) + " |
" );
htmlObj[key ] = printValue(v);
}
//printValue(v);
}
}
}
}catch(err){
console.log(err);
}
return output;
}
}catch(err){
console.log( err );
}
function printArrayValues(arrObj,pkey,level){
var output ="";
var arrayHtmlStr ="";
try{
for(var i=0;arrObj != null && i" + pkey + "." + key + " | " +printValue(o) + " | " );
htmlObj[pkey + "." + key ] = printValue(o);
//console.log(pkey + ":" +printValue(o) );
//output += tabs(level) + "" + 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 "";
}
}