如何将ajax(xmlhttprequest)转换为字符串?

我正在使用webservice url进行ajax调用,并返回数据。浏览器中的url看起来像xml,因为它是xmlhttprequest。 当只有例如一组条目时,我能够打印数据。

You could use .each():

$xml.find("Coupon").each(function() {
    var id = $(this).find("CouponID").text(),
        rewardItem = $(this).find("RewardItem").text();

    alert(id);
    alert(rewardItem);
});

Basically, it's iterating over each Coupon element and finding the CouponID and RewardItem elements inside.