开发者

Jquery xml for each loop not working in IE6

开发者 https://www.devze.com 2023-03-08 22:55 出处:网络
Slight nightmare. This works in every browser except IE in compatibil开发者_运维百科ity mode and IE6.

Slight nightmare. This works in every browser except IE in compatibil开发者_运维百科ity mode and IE6.

I've searched and searched and have no clue to why, can anyone shed any light?

$(document).ready(function () {

    $.ajax({
        type: "GET",
        url: "/Maps/MapResults.aspx",
        dataType: "XML",
        success: function (asd) {

            //This works!
            alert(asd);


            //This doesn't! (in old IE)
            $(asd).find("article").each(function () {

                var category = $(this).find('category').text();
                alert(category);

            });

        }
    }); //close $.ajax(

});


Let MapResults.aspx send and XML-Content-Type-Header (e.g. application/xml) . Also use lowercase-dataType "xml", it may depend on jQuery-Version if dataType is case-sensitive(I'm not 100% sure, but i think it was case-sensitive before 1.5)

0

精彩评论

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