Pulling the first element out of an jqXHR object
Hey Guys. I am just curios to find out how is it possible to pull the first element out of an object. I couldn't anything in the doumentation that can help me.
Below I have preforming an ajax get call from an xml file. I would like to know how I can access the first element. Below is my jquery code...
- <script>
$.get('xml.xml',function (xml){
$("#result").append($(xml).find("speaker").text());
});
</script>
</head>
<body>
<div id="result"></div>
</body>
And here is my XML code. I want to access the first speaker element
- <speakers>
<speaker>Eldan </speaker>
<speaker>Mike </speaker>
<speaker>John </speaker>
<speaker>Paul </speaker>
</speakers>
Thanks for your help in advance!!!