Partial refresh:
There are many methods, the common ones are as follows;
$.get method, $.post method, $.getJson method, $.ajax method are as follows
The first two methods of use are basically the same
$.get(”Default.php”, {id:”1″, page: “2″},
function(data){
//This is the callback method. Return data data. Think here How to deal with it?
});
$.getScript method:
$.getScript("http://jqueryajax.com/jquery.js",
function(){
$("#go") .click(function(){//Callback method
$(”.block”).animate( { backgroundColor: 'pink' }, 1000)
.animate( { backgroundColor: 'blue' }, 1000) ;
});
});
$.getJson just returns a different data type
$.getJson(”Default.php”, {id:”1″, page: “2″},
function(data ){
// Note that the JSON data reference method returned here is "data.info". If you don't understand, you can check the json tutorial. I won't explain too much here
});
$.ajax This method is probably used by many people. But I don't really like using this. Personally, I think the first two are more convenient
$.ajax({
type: “POST”, //Submission type
url: “some.php”, //Submission address
data: “name=John&location=Boston”, //Parameters
success: function(msg){ //Callback method
alert( “Data Saved: ” msg ); //Here is the method content, the same as the get method above
}
});
The following introduces the full page refresh method: sometimes
window.location.reload() may be used to refresh the current page.
parent.location.reload() refreshes the parent object (for frames)
opener.location.reload() refreshes the parent window object (for single window)
top.location.reload() refreshes the top object (for multiple windows)