Reputation: 2050
I created a asp page. Also I created a asp.net web service. And I caught this webservice response using javascript in asp page. But I got that.
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://localhost/DevTrack4U">**True**</string>
I want to get the value that is True. But I got like this. How can I retrieve this.
Upvotes: 0
Views: 194
Reputation: 32522
The easiest way is to use jQuery:
$.ajax({
type: "GET",
url: "http://MyPathToWebServiceGoesHere/",
dataType: "xml",
success: function(xml) {
var myString = $(xml).find('string').text();
}
});
This code will work if there is only one "string" element. FWIW, I suggest using a more descriptive name than "string".
Upvotes: 2