Bonjour,
plusieurs erreurs, y compris dans le structure du xml
"extrait", uniquement pour FF ( comme tu dis qu'avec IE ça baigne,
mais franchement... je doute ! )
<html>
<head>
<title>TEST AJAX</title>
</head>
<body>
<script>
xhr=new XMLHttpRequest();
xhr.onreadystatechange = function()
{ if(xhr.readyState == 4)
{ var xmldoc = xhr.responseXML;
alert(xmldoc.getElementsByTagName("bookcategory")[0].firstChild.nodeValue);
}
}
xhr.open( "GET", "xml.xml", true);
xhr.send(null);
</script>
</body>
</html>
et le xml :
<?xml version="1.0" encoding="utf-8"?>
<bookstore>
<book>
<bookcategory>COOKING</bookcategory>
<title>Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book>
<bookcategory>CHILDREN</bookcategory>
<title>Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
</bookstore>
au fait,
pour ie
xmlD=new ActiveXObject('Microsoft.XMLDOM');
xmlD.onreadystatechange = function ()
{ if ( xmlD.readyState == 4 )
{ xmlFin(xmlD); }
}
xmlD.load(ficXml);
pour FF,opera,k-meleon
xmlD = document.implementation.createDocument('', '', null);
xmlD.onload = function()
{ xmlFin(xmlD); }
xmlD.load(ficXml);
et pour safari, iron (chrome) :
xmlD = new XMLHttpRequest();
xmlD.onreadystatechange = function()
{ if( xmlD.readyState == 4 )
{ xmlFin(xmlD.responseXML); }
}
xmlD.open( 'GET', ficXml, true );
xmlD.send( '' );
Cordialement [
mon Site] [
M'écrire]

Bul