js中同步與異步請求方式

異步請求方式:html

$.ajax({
url : 'your url',
data:{name:value},
cache : false,
async : true,
type : "POST",
dataType : 'json/xml/html',
success : function (result){
do something....
}
});ajax

同步請求方式:json

$.ajax({
url : 'your url',
data:{name:value},
cache : false,
async : false,
type : "POST",
dataType : 'json/xml/html',
success : function (result){
do something....
}
});異步

相關文章
相關標籤/搜索