print object:
function vardump(obj,objname,deep){
deep = deep||1;
if(deep > 5) return "";
deep++;
/* 不是对象也不是数组 */
if(typeof(obj) != 'object' && typeof(obj) != 'array'){
document.writeln("<div>"+objname+"不是对象或者数组["+typeof(obj)+"]</div>");
return '';
}
/* 开始打印 */
document.writeln("<ul>");
for(var i in obj){
document.write("<li>");
document.write(objname+'['+i+'] = '+obj[i]);
if(typeof(obj[i]) == 'object' || typeof(obj[i]) == 'array'){
document.write('<b style="font-size:13px;cursor:pointer;" mce_style="font-size:13px;cursor:pointer;" οnclick="if(this.textContent==\'explode\'){this.textContent=\'collapse\';this.nextSibling.style.display=\'block\';}else{this.textContent=\'explode\';this.nextSibling.style.display=\'none\';}">collapse</b>');
vardump(obj[i],objname+"["+i+"]",deep);
}
document.write("</li>");
}
document.writeln('</ul>');
}