JSON

如何实现 jquery json 模糊查询

字号+ 作者:H5之家 来源:H5之家 2017-10-19 18:55 我要评论( )

CSS code var people= {"userDetails": [ {"sm_uid":"226","sm_user":"librashengsh","sm_uname":"ss","sm_tea_pic":"TeacBbsPic/20100422094813.jpg"}, {"sm_uid":"231","sm_user":"ssssss","sm_uname":"ss","sm_tea_pic":"TeacBbsPic/20100505135408.jpg"}

CSS code
var people=
{"userDetails":
[
{"sm_uid":"226","sm_user":"librashengsh","sm_uname":"ss","sm_tea_pic":"TeacBbsPic/20100422094813.jpg"},
{"sm_uid":"231","sm_user":"ssssss","sm_uname":"ss","sm_tea_pic":"TeacBbsPic/20100505135408.jpg"},
{"sm_uid":"295","sm_user":"yusuke","sm_uname":"ykl","sm_tea_pic":"images/upic.gif"},
{"sm_uid":"227","sm_user":"abcdefg","sm_uname":"abc","sm_tea_pic":"TeacBbsPic/20100422154044.jpg"}
]};
for (var i in people['userDetails']) {
if (people['userDetails'][i].sm_uid.indexOf('2') != -1) {
alert(people['userDetails'][i].sm_uid);
}
}

 

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

相关文章
  • 如何在JS 中获取 JSON 对象中某个域的值

    如何在JS 中获取 JSON 对象中某个域的值

    2017-10-14 13:13

  • asp如何解析json序列

    asp如何解析json序列

    2017-10-13 17:00

  • jQuery.parseJSON(json)将JSON字符串转换成js对象

    jQuery.parseJSON(json)将JSON字符串转换成js对象

    2017-10-13 10:00

  • 前端json数据如何安全传输

    前端json数据如何安全传输

    2017-10-09 10:00

网友点评