[AJAX] FF plante sur appel Ajax !
Bonjour à toutes et à tous.
Je suis passé à FF 2.0.0.11 et cela fonctionne parfaitement.
Comme quoi !
Le script suivant fonctionne parfaitement avec IE, mais plante avec Firefox 2.0.0.7
Une idée pour m'aider ?
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 31 32 33
| <head>
<script language="javascript">
function ajaxResultatTexte(url) {
// alert("ici JS");
var xhr_object = null;
if (window.XMLHttpRequest) {
xhr_object = new XMLHttpRequest();alert("Firefox");}
else if (window.ActiveXObject) {
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");alert("IE");}
else {alert("Pas de XMLHTTPRequest");return;}
//
xhr_object.open("GET", url+"?www=12345", false);
xhr_object.send(null);
if (xhr_object.readyState == 4) { // alert("Vaut 4" );
var reponse=xhr_object.responseText;
document.forms["monFormulaire"].elements["visualisation"].value=reponse;
eval(reponse);
}
else { alert("Vaut pas 4"); }
}
</script>
</head>
<body>
<!--
-->
<a href="javascript:ajaxResultatTexte('ajax2.php')">Go AJAX TEXTE</a>
<br />
<form name="monFormulaire">
<textarea name="visualisation" style="width:400px;heigth:150px;" rows="20">
</textarea>
</form>
</body> |
Et ajax2.php :
Code:
1 2 3
| <?php
print('alert("Bravo Belo");');
?> |