How to fire deviceready event in Chrome browser (trying to debug phonegap project)

Add this code to your onLoad handler function:

    if (navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/)) {
        document.addEventListener("deviceready", onDeviceReady, false);
    } else {
        onDeviceReady();
    }

Event “deviceready” is fired in cordova.js so I don’t know a way to detect existence of this event in application code.

Leave a Comment

tech