开发者

parsing simple xml with jquery

i've got a simple xml file (called by ajax) that contains only:

<result>1</result>开发者_开发问答

with jquery, i can get the value (1) of result?

thanks! Rob


$.ajax({
    url: '/foo.xml',
    success: function(xml) {
        alert($(xml).find('result').text());
    }
});


jQuery.get('myxml.xml', function(xml){
    var result = jQuery(xml).text();
    alert(result);
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜