Parsing xml with jQuery in IE6/7 issue
I have some problem with parsing XML in Ie6/7(original 7 no compatible mode). On Another normal browsers it works.
Jquery code:
$.ajax({
type: "GET",
url: "test.xml",
dataType: "html",
success: function(xml) {
$(xml).find('quoteresult').each(function(){
var bid = $(this).find('bid').text();
alert(bid);
});
}
});开发者_如何学JAVA
When I do alert(xml);
I see all XML file even in IE6, but alert($(xml).html());
, In ie6 it is empty , in FF it works !!
I can't understand what is wrong !
Thanks
Make sure that your XML has no whitespace. As Firefox ignores it whereas IE6/7 breaks. You can add:
error: function(XMLHttpRequest, textStatus, errorThrown){
alert(textStatus);
}
to check for errors thrown back.
精彩评论