开发者

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".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜