+ 1
Why does removeChild not work?
I've been making sort of a browser, and I want it to be where you type in a word, the video linked to that word pops up, and I decided to do that by using the removeChild method on the videos I didn't want, but it seems the system doesn't recognize it. Why is this? My code is below, thank you in advance! https://code.sololearn.com/W54CspHWscfF/?ref=app
8 Réponses
+ 3
Change
browser();
to
window.onload = browser;
+ 1
I don't think that was it
https://code.sololearn.com/W54CspHWscfF/?ref=app
+ 1
You problem is not solved.
Not
window.onload = browser();
It's
window.onload = browser;
+ 1
+ 1
Do you want me to call the whole function in window.onload or just declare it in window.onload?
+ 1
I'm very sorry to keep wasting your time, but how do I make it a callback function?
0
No,
like this window.onload = browser;
Look careful what's the difference? mine code and yours?
0
If you call browser() on window.onload, you will get error due to elements are not ready.
You need to set browser as callback, let onload to call the callback.
So set
window.onload = browser;
to make browser as callback function.