ajax基本語法
$.ajax({
type: "post", //數據的提交方式(post\get)
url: "text.php", //提交的url地址
data: {name:name,pwd:pwd},//需要提交的數據
dataType: "json",//返回的數據類型格式
success: function(msg){ //返回成功的回調函數
},
error:function(msg){ //返回失敗的回調函數
}
});php端的接收方法
html端代碼text.html
ajaxTest
php端代碼text.php
在text.html中加入以下js代碼
上一篇: 細節決定成敗,互聯網建設中同樣需要細節
下一篇: Thinkphp5 驗證碼使用方法詳解
關鍵詞:



