如题所述
看什么语言。Javascript如下
var json = {"name":"sojson 在线工具"};
if(typeof json == 'object'){
console.log("这是JSON对象");
}
var json = '{"name":"sojson 在线工具"}';
if(typeof json == 'string'){
console.log("这是字符串");
}
var json = {"name":"sojson 在线工具"};
if(typeof json == 'object'){
console.log("这是JSON对象");
}
var json = '{"name":"sojson 在线工具"}';
if(typeof json == 'string'){
console.log("这是字符串");
}
温馨提示:答案为网友推荐,仅供参考