//js对象打印函数 function writeObj(obj) { var description = ""; for (var i in obj) { var property = obj[i]; description += i + " = " + property + " "; } alert(description); }