JS判断是否是JSON类型

var isJson = function(obj){
    var isjson = typeof(obj) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && !obj.length;
    return isjson;
}
posted @ 2021-01-27 15:21  智昕  阅读(695)  评论(0)    收藏  举报