Return to Snippet

Revision: 67059
at August 6, 2014 02:09 by dmkim


Initial Code
var s='';
          //--------------------
          function get_obj(objel, deep) {
         
              var s3= new Array(deep*3).join(' ');
                 
              for (var el in objel) {
               
                  s3+=typeof(objel[el])+' : '+el+' = '
                         
                          if (typeof(objel[el])=='object')
                         
                              s3+=String.fromCharCode(13)+String.fromCharCode(10)+
                                       get_obj(objel[el], deep+1);
                           else {
                              s3+= objel[el]+String.fromCharCode(13)+String.fromCharCode(10);
                                  }
             }
                 return s3;
         
          }
          //--------------------
          s=get_obj(inf,0);

Initial URL


Initial Description
Print json object in JavaScript

Initial Title
Print json object in JavaScript

Initial Tags


Initial Language
JavaScript