TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
karthika pommudu
NA
321
34.6k
how to get xml parse value in loop..
Mar 16 2019 6:31 AM
Here,I want to get (loop)the number of Latitude & Longitude from response to var data,data1.
Help me to solve this ...
{"Last30PointsDataJSon":[{"Latitude":11.766470,"Longitude":77.884158,"Speed":11.00,"PositionTime":"16/Mar/2019 04:32:32 PM","PositionType":"GPS","Direction":"NorthWest","ACC":"Off","Battery":"100%","GSMStrength":"Strong Signal","PowerStatus":"Power Connected"},{"Latitude":11.766087,"Longitude":77.884393,"Speed":35.00,"PositionTime":"16/Mar/2019 04:32:22 PM","PositionType":"GPS","Direction":"NorthWest","ACC":"Off","Battery":"100%","GSMStrength":"Strong Signal","PowerStatus":"Power Connected"},{"Latitude":11.765148,"Longitude":77.884998,"Speed":45.00,"PositionTime":"16/Mar/2019 04:32:12 PM","PositionType":"GPS","Direction":"NorthWest","ACC":"Off","Battery":"100%","GSMStrength":"Strong Signal","PowerStatus":"Power Connected"}]}
var
txt =
'<?php echo $response;?>'
//here,I got the Json response (above response)
var
parser, xmlDoc;
parser =
new
DOMParser();
xmlDoc = parser.parseFromString(txt,
"text/xml"
);
var
data = xmlDoc.getElementsByTagName(
"Latitude"
)[0].childNodes[0].nodeValue;
var
data1 = xmlDoc.getElementsByTagName(
"Longitude"
)[0].childNodes[0].nodeValue;
console.log(data,
','
,data1);
var
locations=[
[data,data1]
];
..............................................................
Reply
Answers (
2
)
Get address from latitude & longitude
Uncaught TypeError: map.drawCircle is not a function