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
Post a Comment