function print_r(theObj){ var result = ''; if(theObj.constructor == Array || theObj.constructor == Object){ for(var p in theObj){ if(theObj[p].constructor == Array|| theObj[p].constructor == Object){ result = result + "
  • ["+p+"] => "+typeof(theObj)+"
  • "; result = result + print_r(theObj[p]); } else { result = result + "
  • ["+p+"] => "+theObj[p]+"
  • "; } } } return result; }