我希望在jQM和主幹網頁過渡期間顯示加載消息。但showPageLoadingMeassage不起作用。 以下是我的代碼: collection.js
findById : function(artistId, page, limit, sort) {
$.mobile.showPageLoadingMsg('a', 'Loading......', false);
var self = this;
if (limit == undefined) {
limit = 10;
}
$.mobile.showPageLoadingMsg('a', 'Loading......', false);
console.log("hello");
$.ajax({
type: "GET",
url: siteURL + 'artists/artist_detail/artist_id' + artistId + '.json',
}).done(function(msg) {
var response = JSON.parse(msg);
if (response.status == true) {
var dataArray = response.data;
console.log(dataArray);
self.reset(dataArray);
if (self.length > 0) {
$.mobile.hidePageLoadingMsg();
}
//return dataArray;
} $.mobile.showPageLoadingMsg($.mobile.pageLoadErrorMessageTheme, 'Sorry! No records found', true);
setTimeout(function() {
$.mobile.hidePageLoadingMsg();
}, 1500);
}
});
}
這裏我收到錯了嗎?
編輯: 它工作時的搜索頁面:
... findByTitle : function(keyword, genre, language, page, limit, sort, collection, fan, featured) {
//~ console.log(page);
var self = this;
if (limit == undefined) {
limit = 10;
}
$.mobile.showPageLoadingMsg('a', 'Searching......', false);
$.ajax({....
定義「不工作」 –
不工作意味着在頁面轉換期間,加載信息不會顯示出來。 console.log(「hello」)確實被調用,但msg不顯示。希望我明確自己。 – z22
你有沒有嘗試去掉AJAX調用,並簡單地將消息留在那裏而不隱藏它 - 確保它實際上顯示在所有? –