检测对象是否是json

检测一个对象是否是一个对象的方法:

if(typeof(obj) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && !obj.length){  
    alert('是JSON对象');  
} 

猜你喜欢

转载自blog.csdn.net/fly_wugui/article/details/80306843