javascript - XMLHttpRequest readyState is equal to 0 -
I can not find any data with XMLHttpRequest, because its return location returns 0. I have this code:
Function chargerresendiments () {var xhrArrond = new XMLHttpRequest (); Exhausted.OndestateBangze = Charger Around Callback (Exor Arrayed); Var lienDocArrond = 'PHP / script_load_arrondissements_get.php'; ExhaRndand.Open ('GET', Leon Dockerend, True); Console.log ('Arrangement Charges Dan's Le Fisher XML'); XhrArrond.send (zero); } Function charger Aroundcodeback (warning) {Warning (excerpt. Fredstate); }
The warning window shows 0. I tried to open XHR before setting the handler, but still returned 0. Now, the strange thing is that I have several XHRs on that page, and they all work very well, leaving one, and why I can not explain
BTW, my PHP path The path is: http: //localhost/TP2/PHP/script_load_arrondissements_get.php
.
In addition, you should know that this file gives a correct XML content.
This console says about my request:
Nobody knows what can be the problem? Thank you.
xhrArrond.onreadystatechange = chargerArrondCallback (xhrArrond);
You are calling your event handler function and designating your return value ( undefined
) as the event handler.
Change it to:
Exhausted.OndestateBenz = ChargerArandandCallback;
... and then access the XHR object which is associated with this
inside the function
Comments
Post a Comment