遍历对象
转载请注明来源:https://www.cnblogs.com/hookjc/
var str = '';
function ScanObj(obj){
var ct = '';
for (var o in obj){
if (typeof(obj[o]) == ''){
ct = ScanObj(obj[o]);
}else{
str += o + '=' + obj[o] + '\n';
}
}
return ct;
}
var tobj = {
a : 100,
b : 101,
c : 102,
d : 103
};
alert(ScanObj(tobj));