Reputation: 5417
My XML Feed looks like this
Not sure how to read the data using JQuery and show it in HTML ?
I tried to search on Google but no great results found as you can see in my XML there are many many elements
Upvotes: 0
Views: 1174
Reputation: 2775
Is there a particular reason why you need then to convert it in JSON ? you can do it by first parsing the xml data you retrieve and then create the json using JSON.stringify
Here's how to retrieve the xml, you can use either the $.ajax or the $.get methods :
<script type="text/javascript">
$(document).ready(function () {
//YOU CAN USE THIS
$.get("yourfile.xml", function (data) {
alert('Load was performed.');
});
//OR THIS
$.ajax({
type: "GET",
url: "yourfile.xml",
dataType: "xml",
success: function (xml) {
alert('Load was performed.');
}
});
});
</script>
Upvotes: 1