[JSON].typeOf( keyPath )

语法:[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/>"

注意:

返回空字符时,可能是未知类型,或者指定键名不存在!

posted @ 2018-11-18 23:08  1024记忆  阅读(584)  评论(0编辑  收藏  举报