People who often write scripts sometimes use $ajax and sometimes use $post and $get, which are used to get static data files from a Web server.
jquery encapsulates Ajax operations, in jquery the $.ajax () method is the lowest-level method, the 2nd layer is the load (), $.get (), and $.post () methods, and the 3rd layer is the $.getscript () and $.getjson () methods.
1)$.ajax () This method believes that everyone will not be unfamiliar, at the lowest level, the most abundant function.
2) The load () method is the simplest and most commonly used AJAXFANGFA in jquery, which can be loaded into the remote HTML code and inserted into the DOM.
A) examples are as follows:
$ (function () {$ ("#send"). Click (function () {$ ("#resText"). Load ("test.html");});
b) You can also filter the contents of the load, for example, to load only the content of class para in the test.html page:
$ ("#resText"). Load ("test.html . para");
c) In addition, the way of transmission is particularly noteworthy, if there is no parameter when passed, then is the Get method is passed, if there is a parameter for the Post method passed
D) The three callback parameters of its callback function should also be paid more attention to, for example;
$ ("#resText"). Load ("test.html", function (responsetext,textstatus,xmlhttprequest) {//responsetext : Request returned content// Textstatus: Request Status: Success, error, notmodified, timeout 4 kinds of//xmlhttprequest:xmlhttprequest objects});
Deep Analysis ajax--Series (i)