Custom popup JavaScript HTML error! Help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Custom popup JavaScript HTML error! Help

I'm actually trying to create a library of a lot of most used Functions One is popup(custom) It has errors can you help? https://code.sololearn.com/WrYpENS7cXnv/?ref=app

14th Feb 2023, 12:22 PM
Creative Creations 1
Creative Creations 1 - avatar
7 Answers
+ 3
Yes, it's exactly why I shared the feeds post link. If you have read it, you would've fixed the problem by now : ) Wrap parts of the code that interacts with DOM inside a "load" event handler function of `window` object. window.onload = () => { popup("green","","Hi","Demo","","",100,100); }; The JS script is loaded before the DOM was completely loaded, Adding or modifying element(s) when DOM isn't ready was the reason for the error. For more details on that, please read the link in my previous reply.
17th Feb 2023, 11:36 AM
Ipang
+ 2
Function popup() was never invoked. I don't see anything on page, but neither did I see any error message. What error did you see?
16th Feb 2023, 6:53 AM
Ipang
+ 2
Try code
17th Feb 2023, 10:42 AM
Creative Creations 1
Creative Creations 1 - avatar
+ 2
Thanks I read it but didn't understand that and ignored it you may add examples about 3 - 5
17th Feb 2023, 11:37 AM
Creative Creations 1
Creative Creations 1 - avatar
+ 1
I saw about Id things and stuff errors like not defined
17th Feb 2023, 9:30 AM
Creative Creations 1
Creative Creations 1 - avatar
+ 1
Too few detail to conclude anything. Read through this to see whether it is related to your problem, and whether the suggestion works fot you. https://www.sololearn.com/post/90825/?ref=app
17th Feb 2023, 10:03 AM
Ipang
0
What was that 3 - 5 again?
17th Feb 2023, 11:46 AM
Ipang