+ 1

Why is there a ‘Syntax Error’ in my code?

https://code.sololearn.com/Wv5Z0wtTgNxI/?ref=app

17th May 2023, 2:11 PM
Daisy Sudan
8 Answers
+ 2
Not window.onLoad function() No It has to be written as window.onload = function() {
17th May 2023, 2:27 PM
Ugulberto SĂĄnchez
Ugulberto SĂĄnchez - avatar
+ 7
The console is telling you that there's a problem with your 1st line. You're missing the = window.onload = function ()
17th May 2023, 2:19 PM
Ausgrindtube
Ausgrindtube - avatar
+ 4
I can do it, no problem. For future reference, you can either email info@sololearn.com or in the app there's a feedback option. I'll link this thread in my suggestion.
18th May 2023, 8:42 AM
Ausgrindtube
Ausgrindtube - avatar
+ 2
Ugulberto SĂĄnchez or if you want it shorter onload =()=>{ //your code.... } This problem comes up a lot of times. Is there really no way for the Sololearn team to defer the execution of the javascript tab by default?
18th May 2023, 6:37 AM
Bob_Li
Bob_Li - avatar
+ 2
In case anyone is interested, particularly Bob_Li. I've received an email from Sololearn saying the Devs are looking into it.
20th May 2023, 9:39 PM
Ausgrindtube
Ausgrindtube - avatar
+ 1
Bob_Li Could be a good suggestion to add it as boilerplate code in the tab. Do you want to submit it?
18th May 2023, 7:54 AM
Ausgrindtube
Ausgrindtube - avatar
+ 1
Ausgrindtube not sure how to. You'd be doing everyone a big favor if you did it for us.😁
18th May 2023, 8:23 AM
Bob_Li
Bob_Li - avatar
+ 1
I found out why, it is marked as answer
21st May 2023, 12:57 PM
Daisy Sudan