mercredi 1 décembre 2010

lire un fichier XML compatible tout navigateur

$.ajax({
type: "GET",
url: "javascripts/data.xml",
dataType: ($.browser.msie) ? "text" : "xml",
success: function(data) {

var xml;

if (typeof data == "string") {
xml = new ActiveXObject("Microsoft.XMLDOM");
xml.async = false;
xml.loadXML(data);
} else {
xml = data;
}

}
});

Aucun commentaire:

Enregistrer un commentaire