jQuery的map使用
jQuery的map使用
var a = {id:'12345', name:"张三"}; var b = {id:'lisi', name:"李四"}; var map = {}; map.zhangsan = '张三'; alert(map.zhangsan); map[12345] = '张三1'; map['lisi'] = '李四'; alert(map[12345]); alert(map['lisi']); var map=[{id:'1',name:'dong'},{id:'2',name:'zhang'}]; $.test=function(id){ for(var i=0;i<map.length;i++){ if(id==map[i].id){ alert(map[i].name); } } }
相关推荐
zrtlin 2020-11-09
xuebingnan 2020-11-05
wikiwater 2020-10-27
heheeheh 2020-10-19
Crazyshark 2020-09-15
softwear 2020-08-21
ZGCdemo 2020-08-16
jczwilliam 2020-08-16
littleFatty 2020-08-16
idning 2020-08-03
jinxiutong 2020-07-26
lanzhusiyu 2020-07-19
Skyline 2020-07-04
xiaofanguan 2020-06-25
Aveiox 2020-06-23
dragonzht 2020-06-17