While using PhoneGap, it has some default JavaScript code that uses document.addEventListener, but I have my own code which uses window.addEventListener>
The window binding refers to a built-in object provided by the browser. It represents the browser window that contains the document. Calling its addEventListener method registers the second argument (callback function) to be called whenever the event described by its first argument occurs.
Some paragraph.
Following points should be noted before select window or document to addEventListners
window or document but
some events like resize, and other events related to loading,
unloading, and opening/closing should all be set on the window.