handle possible existing window.onload function in the cordova app