examples/cordova1/platforms/android/platform_www/cordova.js
function (type, data, bNoDetach) {
        var evt = createEvent(type, data);
        if (typeof documentEventHandlers[type] !== 'undefined') {
            if (bNoDetach) {
                documentEventHandlers[type].fire(evt);
            } else {
                setTimeout(function () {
                    // Fire deviceready on listeners that were registered before cordova.js was loaded.
                    if (type === 'deviceready') {
                        document.dispatchEvent(evt);
                    }
                    documentEventHandlers[type].fire(evt);
                }, 0);
            }
        } else {
            document.dispatchEvent(evt);
        }
    }
function (type, data, bNoDetach) {
        var evt = createEvent(type, data);
        if (typeof documentEventHandlers[type] !== 'undefined') {
            if (bNoDetach) {
                documentEventHandlers[type].fire(evt);
            } else {
                setTimeout(function () {
                    // Fire deviceready on listeners that were registered before cordova.js was loaded.
                    if (type === 'deviceready') {
                        document.dispatchEvent(evt);
                    }
                    documentEventHandlers[type].fire(evt);
                }, 0);
            }
        } else {
            document.dispatchEvent(evt);
        }
    }
function ( type , data , bNoDetach ) { var evt = createEvent ( type , data ) ; if ( typeof documentEventHandlers [ type ] !== 'undefined' ) { if ( bNoDetach ) { documentEventHandlers [ type ] . fire ( evt ) ; } else { setTimeout ( function ( ) { // Fire deviceready on listeners that were registered before cordova.js was loaded. if ( type === 'deviceready' ) { document . dispatchEvent ( evt ) ; } documentEventHandlers [ type ] . fire ( evt ) ; } , 0 ) ; } } else { document . dispatchEvent ( evt ) ; } }
Method to fire event from native code
bNoDetach is required for events which cause an exception which needs to be caught in native code
Method to fire event from native code bNoDetach is required for events which cause an exception which needs to be caught in native code