I try to read a specific value of a XML feed. Evertyhing is working but I want to read the "StartTime=" value too.
This is the XML:
<Program StartTime="17:00:00" EndTime="17:30:00">
<Name>name</Name>
</Program>
And this is the code:
$.ajax({
type: "GET",
url: "./data.xml",
dataType: "xml",
error: function (e) {
alert("An error occurred while processing XML file");
console.log("XML reading Failed: ", e);
},
success: function (response) {
$("ul").children().remove();
$(response).find("Program").each(function () {
var _name = 'Program: ' + $(this).find('Name').text();
console.log(_name);
var _time = 'Time: ' + $(this).find('StartDateTime').text();
// add content to the HTML
$("ul").append('<li>' + _name + '</li>');
$("ul").append('<li>' + _time + '</li>');
});
}
});
}
I found some interesting information, but I can't actually use it...