Bob Zoller

ruby, rails, san francisco, photography, startups, food

Find me on:
 - github
 - linkedin
 - flickr

PhoneGap “deviceready” gotcha

I was hacking on a PhoneGap app yesterday, and at one point the deviceready event stopped firing. Poked around and discovered that phonegap.js actually redefines document.addEventListener with its own custom version. My problem was that I was attaching the event listener before I loaded phonegap.js … which meant I never called their custom addEventListener and hence never got the event.