jQuery中Ajax的全局設(shè)定$.ajaxSetup()
$.ajaxSetup({
//全局設(shè)定
url:"a.html",
success: function(data){
$("#serverResponse").html(decodeURI(data));
}
})
function doRequestUsingGET(){
$.ajax({
data: createQueryString(),
type: "GET"
});
}
function doRequestUsingPOST(){
$.ajax({
data:"firstName="+firstName+"&birthday="+birthday;
type: "POST"
});
}
//全局設(shè)定
url:"a.html",
success: function(data){
$("#serverResponse").html(decodeURI(data));
}
})
function doRequestUsingGET(){
$.ajax({
data: createQueryString(),
type: "GET"
});
}
function doRequestUsingPOST(){
$.ajax({
data:"firstName="+firstName+"&birthday="+birthday;
type: "POST"
});
}
posted on 2012-05-17 11:38 youngturk 閱讀(2185) 評論(0) 編輯 收藏 所屬分類: Ajax