The onload event can also be used to deal with cookies (see "More Examples" So DOMContentLoaded definitely happens after such scripts: In the example above, we first see Library loaded, and then DOM ready! (all scripts are executed). Enter the URL of the website. Method 1 Here the target page is not called directly. ,