0
我使用的Apache Cordova在移動應用程序的工作。我有一個JavaScript文件,從蔚藍的移動服務中讀取數據,並持續,到本地SQLite數據庫..查詢蔚藍的移動服務使用javascript
我有一個函數,旨在查詢天藍色的移動服務,但它給了我一個錯誤 - 「不能讀取」undefinedType屬性「。功能如下
function refreshQuestionsTable() {
alert("questions refreshing");
var query = QuestionsTable.take(100).read().done(function (results) {
alert(results.length); //see how many records were returned
for (var i = 0; i < results.length; i++) {
alert(results[i].question); //display the question returned
commitQuestions(results[i].question_id, results[i].client_ref, results[i].question_set, results[i].question_dept, results[i].question, results[i].question_branch, null);
}
},function (err) {
alert("Error: " + err);
});
}
定義變量'QuestionsTable'在哪裏? – carlosfigueira
在這裏同意 - 問題中沒有足夠的信息來確定你哪裏出錯,但我懷疑它在QuestionsTable的定義中。查看Azure移動服務Cordova SDK:https://github.com/azure/azure-mobile-services-cordova –
問題的定義如下var MobileServiceClient = WindowsAzure.MobileServiceClient; var client = new MobileServiceClient('https://feedbackmaster.azure-mobile.net/','oLMEOExWGFolBhpyYpTFkqvKuLNlyL91'); var QuestionsTable = client.getTable('client_questions'); –