deviceready
不再在第二頁上觸發。 假設我有:iOS - deviceready在5秒後未觸發
page1.html
- 輸入頁面。
和
page2.html
- 另一頁。
在第1頁,我有這樣的代碼:
document.addEventListener("deviceready", onDeviceReadyPopup, false);
function onDeviceReadyPopup(){
window.location.href="page2.html";
}
在第2頁,我有這樣的代碼:
document.addEventListener("deviceready", onDeviceReady, true);
function onDeviceReady() {
alert("Script - Device ready!");
}
問題:警報從未解僱,因爲它不會觸發事件deviceready
。這將在android
中正常工作。
我懷疑這是因爲我使用的是window.location.href
?
你如何在iOS應用程序中設置視圖?您是否使用自定義網頁代理? – Jason