0

我已经在 main.js 中编写了这段代码并添加了这个文件 index.html 但在 android 模拟器事件上一切正常但在设备就绪事件上显示错误在 cat 日志上显示设备就绪事件未触发我不明白我错在哪里这段代码有任何问题。

main.js

$(document).ready(function () {
        // setup global error handler
        window.onerror = function (message, url, lineNumber) {
            console.log([lineNumber, url, message].join(" "));
            return false;
        };

        window.isphone = false;
        if(document.URL.indexOf("http://") === -1 
            && document.URL.indexOf("https://") === -1) {
            window.isphone = true;
        }

        if(window.isphone) {
            document.addEventListener("deviceready", onDeviceReady, false);
        } else {
            onDeviceReady();
        } 

        console.log("document.ready");
        console.log(window.location.hash);

        // start the app
    });

    function onDeviceReady() {
        app.init();
    }

    var app = app || { _timeStart: null };

    app.init = function () {

//events binding
        });     
    };
4

0 回答 0