+ 1
How can I run javascript after background image of body has fully loaded?
8 ответов
+ 1
Your console was returning an error , await is only valid in async function.
Rectify your code to:
window.onload = async function(){
var url = await fetch(//your codes.....)
}
0
Not sure if this answers your question but try:
window.onload = function(){
/*the code that you want to run after the whole page is fully loaded*/
}
0
I did that, but it never ran the script.
0
If you have your code in sololearn, please attach the link, this will be helpful in figuring out whats wrong.
0
ok, but it’s still running the script without fully loading the background image.
0
Lets wait for others responses! Stuck too!
0
thanks for the help!