Local refresh:
This method is more go, common have the following several;
$.get method, $.post method, $.getjson method, $.ajax method is as follows
The first two ways are basically the same
Copy Code code as follows:
$.get ("default.php", {ID: "1″, Page:" 2″},
function (data) {
Here is the callback method. Returns data. Here's how to deal with it.
});
$.getscript Method:
Copy Code code as follows:
$.getscript ("Http://jqueryajax.com/jquery.js",
function () {
$ ("#go"). Click (function () {//callback method
$ (". Block"). Animate ({backgroundcolor: ' Pink '}, 1000)
. Animate ({backgroundcolor: ' Blue '}, 1000);
});
});
$.getjson just returned a different type of data
Copy Code code as follows:
$.getjson ("default.php", {ID: "1″, Page:" 2″},
function (data) {
Note that the JSON data reference method returned here is "Data.info", and it is not clear that you can check out the JSON tutorial. There's not much to explain here.
});
$.ajax This method is estimated to use a lot of people. But I don't like to use it very much. Personally think the front two more convenient
Copy Code code as follows:
$.ajax ({
Type: "POST",//Submitted types
URL: "some.php",//Submit Address
Data: "Name=john&location=boston",//Parameter
Success:function (msg) {//callback method
Alert ("Data Saved:" + msg);//This is the content of the method, like the Get method above
}
});
The full page Refresh method is described below: sometimes you might use
Window.location.reload () refreshes the current page.
Parent.location.reload () Refreshes the Father object (for frames)
Opener.location.reload () Refreshes the parent window object (for a single open window)
Top.location.reload () Refreshes the topmost object (for multiple windows)