I have several dynamic pages, and I want to change some elements before the page is fully displayed.
My snippet is something like
document.body.getElementById("change").innerHTML = "<img src...";
I do not have access to change the content server.
Where is the best place to put a piece of code to run the code in front of the page that it displays?
Rather, put javascript in HEAD (inside the window.onload event?) Or before closing BODY (not inside the event listener)?
javascript dom javascript-events rendering pageload
markmarkoh
source share