我在這一個上拉我的頭髮..我有一個.html頁面來表示我的移動應用程序的主頁。在同一個html頁面中,我定義了一個頁面作爲登錄屏幕。顯示登錄界面邏輯的作品就好了... ...我的問題是,我有以下簽名的登錄功能...回調不會在JQuery Mobile中觸發多頁
ajaxLogin(credentials, successCallback, failureCallback) {
$.ajax({
url: SERVER_API + '/login',
data: credentials,
type: 'post',
async: true,
beforeSend: function() {
$.mobile.showPageLoadingMsg(true);
},
always: function() {
console.log('always');
$.mobile.hidePageLoadingMsg();
},
done: function (data, status, xhr) {
console.log('login: ok'); //< -- This never fires but I can see that the server returned a 200 in Safari's developer menu
successCallback();
},
fail: function (request, error) {
failureCallback(); // <-- This function is never executed when I send bad login info. But again, the server is returning an error status code
}
});
}
我認爲這將是非常簡單的...我缺少的東西?
您是對的,先生,謝謝! Mundane細節... – ChickensDontClap