Home > Net >  Questions about ajax, and action
Questions about ajax, and action

Time:10-11

<script>

Var XMLHTTP;
Var aabb;
XMLHTTP=new XMLHttpRequest ();
XMLHTTP. Open (" POST ", "aaaaaaaaaaaa. Ashx", true);
XMLHTTP. The send ();


XMLHTTP. Onreadystatechange=function ()
{
If (XMLHTTP. ReadyState==4 & amp; & XMLHTTP. Status==200)
{
Aabb=XMLHTTP. The responseText;

}
}

Alert (aabb);
Alert (" Thank You ");

<script>


Problem: alert (aabb); For less than the value, the program to perform a second alert, I check a lot of information on the Internet, need to set the async is false, but still the same

XMLHTTP. Open (" POST ", "aaaaaaaaaaaa. Ashx", true);
Change
XMLHTTP. Open (" POST ", "aaaaaaaaaaaa. Ashx", false);
Or no???????

CodePudding user response:

You need other data to cooperate, I tested both, the inside of the parameters is very important,
Pure POST is there will be a lot of problems

CodePudding user response:

And you the original don't write, add a few methods are first, and then to perform the SEND

CodePudding user response:

Aabb=XMLHTTP. The responseText;
Alert (aabb);
This can get it
  • Related