收藏本站腾讯微博新浪微博

经典论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

蓝色理想 最新研发动态 网站开通淘帖功能 - 蓝色理想插件 论坛内容导读一页看论坛 - 给官方提建议

论坛活动及任务 地图和邮件任务 请多用悬赏提问 热夏来袭,选一款蓝色理想的个性T恤吧!

手机上论坛,使用APP获得更好体验 急需前端攻城狮,获得内部推荐机会 论坛开通淘帖功能,收藏终于可以分类了!

搜索
查看: 1798|回复: 0

[求助] javascript如何做到模糊匹配

[复制链接]
发表于 2018-9-3 10:55:18 | 显示全部楼层 |阅读模式

有两个数组。
var json = [
{"id":"1257","value":"0.39","time":"2018/9/3 10:40:30","name":"临东压力"},
{"id":"1258","value":"0.313","time":"2018/9/3 10:40:30","name":"临东水位"},
{"id":"1259","value":"0.382","time":"2018/9/3 10:40:30","name":"龙划压力"},
{"id":"1260","value":"0.176","time":"2018/9/3 10:40:30","name":"龙划水位"},
{"id":"1261","value":"0.36","time":"2018/9/3 10:40:30","name":"平乐压力"},
{"id":"1262","value":"0.27","time":"2018/9/3 10:40:30","name":"平乐水位"},
{"id":"1263","value":"0.266","time":"2018/9/3 10:40:30","name":"圆岭小区泵前"},
{"id":"1264","value":"0.36","time":"2018/9/3 10:40:30","name":"圆岭小区泵后"},

]
var allOverlay= [
{"name":"临东","leixing":"厂","coordinate":"110.344492,21.137511"},
{"name":"平乐","leixing":"厂","coordinate":"110.407909,21.245864"},
{"name":"圆岭小区","leixing":"小区","coordinate":"110.420287,21.232615"},
{"name":"海滨","leixing":"厂","coordinate":"110.420588,21.219622"},
{"name":"龙划","leixing":"厂","coordinate":"110.402404,21.181497"}


];
然后,我怎么通过allOverlay[i].name来获取到对应json下的value
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|Archiver|手机版|blueidea.com ( ICP05002321 )  

GMT+8, 2019-9-16 14:41 , Processed in 0.094488 second(s), 8 queries , Gzip On, Memcache On.

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表