How to make a download of the script after the onload event?
All kind time of day.
Develop the website. Since the site is quite weighty, it loads it is quite slow. But in order that the user saw the process of loading the website I made a preloader. The preloader I put on the event document.body.onload(). But in the download there are processes that could send the user to, such as getting a list of videos with Vimeo.com, get photos from a vk.com. That is, at the time when these resources are loaded, the loading animation appears "loading" and, in principle, for a user do not have to wait for a full load of these resources, as they are loaded asynchronously via Ajax. But how to make the preloader stopped working after the page has loaded, but before loading the Ajax data? In principle, the logic may be this: in the onload function to disable the preloader and start the Ajax load the data, But the point is that Ajax logic is in another file and connects to a separate script file.