webservice and asp
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:/开发者_Python百科/localhost/DevTrack4U">**True**</string>
I want to get the value that is True. But I got like this. How can I retrieve this.
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".
精彩评论