views:

32

answers:

1

Hi,

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);
            });

        }
});

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

A: 

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.

Hugh
No, it doesn't have any space :(
Alexander Corotchi
dataType should be "xml" no?
Hugh
dataType => The type of data expected from the server.
Hugh
here I can't use datatype XML, just HTML
Alexander Corotchi
Try adding the code I have added above like you have with "success:" to see if any errors are thrown back.
Hugh