ajax基本語法
$.ajax({
type: "post", //數(shù)據(jù)的提交方式(post\get)
url: "text.php", //提交的url地址
data: {name:name,pwd:pwd},//需要提交的數(shù)據(jù)
dataType: "json",//返回的數(shù)據(jù)類型格式
success: function(msg){ //返回成功的回調(diào)函數(shù)
},
error:function(msg){ //返回失敗的回調(diào)函數(shù)
}
});php端的接收方法
html端代碼text.html
ajaxTest
php端代碼text.php
在text.html中加入以下js代碼
關(guān)鍵詞:



