how to read xml data in IE browser using jquery Ajax function

前端 未结 4 1530
悲哀的现实
悲哀的现实 2021-01-24 21:06

I need to read xml data using jquery in AJAX function, which is working fine in firefox... however i am stuck with IE browser... I am not able to read xml. program is required t

4条回答
  •  悲&欢浪女
    2021-01-24 21:40

     function parseXML(xml) {
        if (jQuery.browser.msie) {
            alert("dd3");
            var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
            xmlDoc.loadXML(xml);
            xml = xmlDoc;
        }
        alert("dd4");
        return xml;
    }
    
    function searchThis() {
        alert("dd1");
        $.ajax({
            type: "GET",
            url: XMLSource,
            dataType: ($.browser.msie) ? "text" : "xml",
            success: function (xml) {
                alert("dd2");
                var newXML = parseXML(xml);
                loadPublication(newXML)
            }
        });
    }
    

    enjoy with this working for IE.

提交回复
热议问题