GIS的积累
It is never to late to learn

导航

 
 1 //firefox
 2 Interface.send(data,function(msg){
 3             $(msg).find("CARINFO").each(function(i){
 4                 var obj = $(this).children();
 5                 var carlocation = {};
 6                 for(var j=0;j<obj.length;j++){
 7                     var name = obj[j].nodeName;
 8                     var textContent=obj[j].textContent;
 9                     carlocation[name] = textContent;
10                 }
11                 carlocations.push(carlocation);
12             });
13         });
14 
15 
16 
17 //ie
18 $(msg).find("OILWEARINFO").each(function(i){
19                 var obj = $(this).children();
20                 var alarmStat = {};
21                 for(var j=0;j<obj.length;j++){
22                     var name = obj[j].tagName;
23                     var textContent=obj[j].text;
24                     alarmStat[name] = textContent;
25                 }
26                 alarmStats.push(alarmStat);
27             });
28         });
View Code

 nodeName  vs  tagName

 textContent  vs  text

posted on 2013-07-22 10:17  GIS的学习  阅读(478)  评论(1编辑  收藏  举报