语法:[JSON].typeOf( keyPath )
返回:[String | Number | Boolean | Json | Array | Function | 空字符]
说明:获取指定键名值的类型
示例:
Set jsonObj = toJson("{a: 'test', b: 1, c:true, d:[1,2,3,4], e:{a1:2}}")Response.Write "a的类型:"& jsonObj.typeOf("a") & "<br/>"
Response.Write "b的类型:"& jsonObj.typeOf("b") & "<br/>"
Response.Write "c的类型:"& jsonObj.typeOf("c") & "<br/>"
Response.Write "d的类型:"& jsonObj.typeOf("d") & "<br/>"
Response.Write "e的类型:"& jsonObj.typeOf("e") & "<br/>"
注意:
返回空字符时,可能是未知类型,或者指定键名不存在!
更多专业前端知识,请上 【猿2048】www.mk2048.com