jquery版本的ajax請求

2022-10-08 22:03:26 字數 481 閱讀 4204

首先引入

script>

$ 和 jqurey是乙個函式,呼叫函式會返回乙個物件

jquery封裝的ajax-get請求

$函式中有get屬性  加()呼叫

$.get('張三&password=123',

function(date, state, xhr) )

$.get('',

,function(date) )

$.post(''), ,

date=>console.log(date);

}// jquery 粉裝的自定義ajax請求

$.ajax(,

success:date=>console.log(data),              //請求成功的**               結果是個物件

error:error=>console.log(error)               //請求失敗的**

})

jQuery中的ajax請求

全域性配置 1.ajaxsetup方法可以設定全域性配置 1 全域性配置會作為下次ajax方法的預設引數 2 全域性配置可以被ajax方法的配置覆蓋 3 全域性配置適用於所有基於ajax方法的衍生方法 例如 全域性配置 ajaxsetup ajax請求函式 function ajax 2.全域性 1...

jQuery傳送Ajax請求

ajax cache false,async true,type post datatype json xml html success function result ajax cache false,async false,type post datatype json xml html suc...

jQuery傳送Ajax請求

ajax cache false,async true,type post datatype json xml html success function result ajax cache false,async false,type post datatype json xml html suc...