J'utilise jQuery.ajax pour analyser un fichier XML à partir d'un fichier. Tout fonctionne bien dans IE (6,7,8), Firefox, Opera et Safari, mais échoue avec Google Chrome. Voici le code:L'analyse XML jQuery (avec Ajax) ne fonctionne pas dans Chrome (mais fonctionne dans IE, FF, Opera, Safari)
/* ... */
this.loadXml = function()
{
$.ajax(
{
type: "GET",
url: "some_file.xml",
dataType: ($.browser.msie) ? "text" : "xml",
success: function(xml)
{
if($.browser.msie)
{
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.loadXML(xml);
xml = xmlDoc;
}
/* parsing starts here */
/* for example: in the document I have a div tag with id "some text" and the xml file contains: <root><tag>test</tag></root>*/
$("#some_id").text($(xml).find("root > tag").text());
/* parsing ends here */
}
});
}
Ouais ... qui semble être le problème ... Merci pour la réponse rapide! –