A person who often writes scripts. Sometimes use $ajax, sometimes also use $post and $get, these methods are used to get static data files from webserver.
jquery encapsulates Ajax operations, where the $.ajax () method is the lowest-level method in jquery, and the 2nd layer is the load (), $.get (), and $.post () methods. The 3rd layer is the $.getscript () and $.getjson () methods.
1)$.ajax () This method believes that we are not unfamiliar, at the bottom. The most versatile.
2) The load () method is the simplest and most frequently used AJAXFANGFA in jquery, which can load remote HTML code and insert it into the DOM.
A) examples are as follows:
$ (function () {$ ("#send"). Click (function () {$ ("#resText"). Load ("test.html");});
b) also be able to filter the contents of the load, such as only need to load the contents of the Test.html page class para:
$ ("#resText"). Load ("test.html . para");
c) In addition, the way of transmission is particularly noteworthy, assuming that there is no reference to the pass time, then the Get method is passed, assuming that there is a reference to the post method of passing
D) The three callback parameters of its callback function should also be noted, 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)