說明:
ajax路由采用G.url函數生成,用于部署不同域名
參考文檔:
http://www.hmoore.net/calfbaby/calfbb/482568
~~~
$.ajax({
url: "{{G.url('app/login/login')}}",//當前ajax請求的地址
type: 'post',//請求的方式
async: true,//是否異步 ?默認為異步
data: data,//當前ajax請求的參數 ?
dataType: "json",
success: function (data) {//發送成功時的代碼執行
if (data.code == 2001) {
return false;
}
if (data.code == 1001) {
return true;
} else {
}
re_captcha();
},
error: function () {//失敗時的代碼執行
}
})
~~~