我正在開發一個html5 cordova混合應用程序。我有3個HTML頁面。我使用localStorage和SQLite插件。我在這些頁面之間導航。但是,當我從一個頁面移動到另一個頁面時,cordova功能變得毫無用處。「5秒鐘後deviceready還沒有開機」科爾多瓦3.5.0-0.2.1
我的login.html頁:
Document.addEventListener("deviceready",onDeviceReady,false);
function onDeviceReady() {
var db = window.sqlitePlugin.openDatabase({
name : "OZEGE",
bgType : 1
});
//some transactions
}
function Login(){
// my login authorization
}
和授權後,我將我的這個代碼行的其他頁面;
window.location = "experInfos.html";
experInfos.html:`
document.addEventListener("deviceready",onDeviceReady,false);
function onDeviceReady() {
document.getElementById("devamButonu").disabled = true;
var db = window.sqlitePlugin.openDatabase({
name : "OZEGE",
bgType : 1
});
//populate dropdown
populateMensei(db);
}
`
第二頁打開時,控制檯顯示;
deviceready has not fired after 5 seconds. (01:40:11:905)
at www/cordova.js:1154
我不能填充我的下拉列表。它顯示:
SQLitePlugin openargs: {"name":"OZEGE","bgType":1} (02:08:08:610)
at file:///android_asset/www/plugins/org.pgsqlite/www/SQLitePlugin.js:8
但沒有任何反應。爲什麼我不能在第二頁上使用設備?由於config.xml?
試試這個'document.locatiom =「experInfos.html」;' – AtanuCSE
沒有什麼改變。我不認爲問題是關於哪個代碼更改頁面。我想這必須是關於科爾多瓦插件或其他。 –
我有同樣的問題,我不能爲該特定項目使用單頁方法。 – amenthes