javascript - Why this in onDeviceReady is not this as usual? -


below code index.js generated phonegap 3.0, question why not designed allow use this.receivedevent usual (and event object parameter).

// scope of 'this' event. in order call 'receivedevent' // function, must explicity call 'app.receivedevent(...);' ondeviceready: function() {    app.receivedevent('deviceready'); }, 

thanks,

its usual call:

document.addeventlistener("deviceready", ondeviceready, false);  function ondeviceready() {     // safe use device apis } 

refer official site: http://docs.phonegap.com/en/3.0.0/cordova_events_events.md.html#deviceready


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -