Use the window object for alerts in JS