Update app.js

Entered the window object as the first item in the code to act as a placeholder for the DOM object in the browsers.