I want to access each lat and log value of this XML file using JavaScript and AJAX. Is there anyway I can loop through each of the values and display them? I already did the AJAX part. Would really appreciate your help. Thanks.
$.ajax({
type:'get',
url: "2017-04-25_163304_assign2017.gpx",
data: {
key: "value"
},
dataType: "xml",
success: function(xml){
}
<?xml version="1.0"?>
<gpx version="1.0" creator="Ultra GPS Logger" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/0" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
<trk>
<name><![CDATA[assign2017]]></name>
<trkseg>
<trkpt lat="35.876466" lon="14.508177"><ele>134.75</ele><time>2017-04-25T14:33:30Z</time></trkpt>
<trkpt lat="35.876254" lon="14.508889"><ele>-30.52</ele><time>2017-04-25T14:33:31Z</time></trkpt>
<trkpt lat="35.876147" lon="14.509038"><ele>-13.17</ele><time>2017-04-25T14:33:33Z</time></trkpt>
<trkpt lat="35.876170" lon="14.508932"><ele>99.07</ele><time>2017-04-25T14:33:34Z</time></trkpt>
</trkseg>
</trk>
</gpx>