js怎么判断字符串是否为json格式

function isJSON(str) { if (typeof str == 'string') { try { var obj=JSON.parse(str); if(typeof obj == 'object' && obj ){ return true;
相关文章
相关标签/搜索