<script type= "Text/javascript" language= "JavaScript" src= "Js/jquery-1[1].2.3.min.js" ></script> < Script type= "Text/javascript" language= "JavaScript" > $ (document). Ready (function () {//jquery page load event, This method is first executed after the page is loaded//the first Ajax request $.ajax ({type: "get",///request type, with get,post type, and form submission is the same URL: "result.aspx",//Request processing page, that is, the page to capture the request, the same path can be replaced by ASHX, general handler data: "Name=john&location=boston",//Transfer parameters, is really (Result.aspx?name=john
&loaciton=boston) success:function (msg) {//The success of the request is handled by this method, where the request for a successful return value is received by MSG $ ("#ajaxDIV"). Text (msg);
}
}); The second request $.get (////Get request method, in fact, is the variant of the previous one "Handler.ashx", {name: "Stupid Bear", sex: "Female"},///To pass the parameter, parse to (Handler
. ashx?name= Bear &sex= Female) function (msg) {//Request return parameter $ ("#Div1"). Text (msg);
}
); The third request $.post (//The previous one of this request is the same, but the request is different "handler2.ashx", {name: "Benben stupid Bear", sex: "Female"}, function (msg)
{$ ("#Div2"). Text (msg);
}
); The fourth kind of request $.getJSON (//This is implemented in JSON, JSON is a generic data format "HANDLER3.ASHX",//path {name: "AAA"},///pass parameter function (data) { The callback processing function returns the JSON data format, which receives the data var str= "";
The following is the analysis of these data, the use of specific transfers but do not consider, the design of a lot of content, temporarily unable to explain str+= "name: " +data.name+ "<br/>";
str+= "Sex: " +data.sex+ "<br/>";
str+= "Address: " +data.address+ "<br/>";
$ ("#Div3"). html (str);
}
);
}); </script>
The above is the entire contents of this article, learn more jquery syntax, you can see: "JQuery 1.10.3 Online Handbook", also hope that we support the cloud-dwelling community.