[AJAX] acces refusé sur execution script ajax avec IE
Bonjour,
lorsque j'execute le script suivant, ca marche sous FF mais par contre sous IE il me met acces refusé...
HTML :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<body>
<script type="text/javascript" src="ajax3.js"></script>
<p>
<a href="javascript:ajax('video1');">Cliquez-moi toujours !</a>
</p>
<br/><br/><br/>
<!--<input type="text" value="" id="link0" size="auto"/>
<input type="text" value="" id="link1" size="auto"/>-->
<div id="blo" style="margin-right:auto;margin-left:auto;widht:auto;border:1px solid black;text-align:center;">
</div>
</body>
</html> |
JS :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| function ajax(dossier)
{
var xhr=null;
if (window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
//on définit l'appel de la fonction au retour serveur
xhr.onreadystatechange = function() { alert_ajax(xhr); };
xhr.open("GET", dossier+"/vid1.xml", true);
xhr.send(null);
}
function alert_ajax(xhr)
{
var docXML= xhr.responseXML;
var items = docXML.getElementsByTagName("donnee")
//on fait juste une boucle sur chaque élément "donnee" trouvé
var partie=1;
for (i=0;i<items.length;i++)
{
document.getElementById('blo').innerHTML = document.getElementById('blo').innerHTML +"<a href=\""+ items.item(i).firstChild.data +"\"> Liens vers la partie "+partie+"<br/>";
partie++;
}
} |
XML:
Code:
1 2 3 4 5 6 7
| <?xml version="1.0"?>
<exemple>
<donnee>dvd1355-scn_1-6.part1.rar</donnee>
<donnee>dvd1355-scn_1-6.part2.rar</donnee>
<donnee>dvd1355-scn_1-6.part3.rar</donnee>
<donnee>dvd1355-scn_1-6.part4.rar</donnee>
</exemple> |
avez vous une petite solution a ce probleme?
Merci