JS判断数据是否是JSON类型

var isJson = function(obj){
    var isjson = typeof(obj) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && !obj.length;
    return isjson;
}

  

posted @ 2013-04-19 10:45  潁川君  阅读(2968)  评论(2编辑  收藏  举报