filmov
tv
html - How to make JavaScript execute after page load?

Показать описание
#short
#javascript
#html
#dom
#dom-events
#pageload
I'm executing an external script, using a script inside head.
Now since the script executes before the page has loaded, I can't access the body, among other things. I'd like to execute some JavaScript after the document has been "loaded" (HTML fully downloaded and in-RAM). Are there any events that I can hook onto when my script executes, that will get triggered on page load?
#javascript
#html
#dom
#dom-events
#pageload
I'm executing an external script, using a script inside head.
Now since the script executes before the page has loaded, I can't access the body, among other things. I'd like to execute some JavaScript after the document has been "loaded" (HTML fully downloaded and in-RAM). Are there any events that I can hook onto when my script executes, that will get triggered on page load?