The first type of Ajax request
$.ajax ({type: "GET",//request type, Get,post type, and form submission are the same
URL: "Result.aspx",//request processing of the page, that is, the page captures the request, the same path can be changed to ASHX, the general processing program
Data: "Name=john&location=boston",//pass parameters, it is (Result.aspx?name=john&loaciton=boston)
Success:function (msg) {///Request success will be handled by this method, where the request for a successful return value is received by MSG $ ("#ajaxDIV"). Text (msg);}});
Second kind of request
$.get (//Using GET request mode, is actually the variant of the previous one
"Handler.ashx",
{name: "Dumb Bear", Sex: "Female"},
The parameter to pass resolves to (handler.ashx?name= &sex=) function (msg) {//Request return parameter $ ("#Div1"). Text (msg);});
Third Kind of request
$.post (//The previous type of the request is the same, but the request is in a different way
"Handler2.ashx",
{name: "Benben stupid Bear", sex: "Female"},
Function (msg) {
$ ("#Div2"). Text (msg); } );
Several ways that Ajax requests general handler parameter passing