+ 2
Why if we don't use the window.onload function in JavaScript the innerHTML cant work?
I have some problem here, why if we use window.onload in javascript the innerHTML is executed, but if i am not use window.onload the innerHTML was not executed?? Ex : https://code.sololearn.com/WEXTh9iiw4se/?ref=app
21 ответ
+ 5
That is because you must include your .js file in your .html file for any JavaScript to work.
The window.onload function helps you do that indirectly here. So your .js is executed that way after the page is loaded.
Or you can do this to achieve the same. Just click on "Text" to see it change.
https://code.sololearn.com/WpZSI5kwoQXr/?ref=app
Read this for clarity.
https://www.sololearn.com/post/7444/?ref=app
+ 2
Wtf man?
+ 2
Would you stop it
+ 2
I don't know how
+ 2
He's done it to me too, I've reported their account as I believe it could be fake
+ 2
Oh sorry I didn't mean you Yadi I meant that Nicholas guy
+ 2
Hope the bot is gone.
+ 2
Ya me too
+ 1
That guy's account has been block
+ 1
Haha nice
+ 1
Well how with my question 😐
+ 1
I'm not sure I started using SoloLearn again yesterday I haven't been coding in the last few months, sorry I couldn't help😔
0
No problem bro