Add the window load event listener before making the data request.