+ 2

A javascript error

I have been working on an image editor and it worked fine on my laptop but when i upload it here it gives an error can anyone tell me what is wrong with it https://code.sololearn.com/WQqmPZ46NFUt/?ref=app

16th May 2019, 2:39 AM
Hassan Alkholy
Hassan Alkholy - avatar
3 Respuestas
+ 4
It's the usual problem here of JavaScript running before the HTML is fully loaded. To fix it, simply encase everything in the JavaScript tab within: window.onload = function(){ All of your current JavaScript here } That will cause the JavaScript to not run until the HTML is fully loaded and so fixes that error.
16th May 2019, 3:25 AM
Decimis † 𝕯𝖊𝖈𝖎𝖒𝖎𝖘
Decimis † 𝕯𝖊𝖈𝖎𝖒𝖎𝖘 - avatar
+ 3
Thank you man it works 👍
16th May 2019, 3:36 AM
Hassan Alkholy
Hassan Alkholy - avatar
+ 2
I know the code might look annoying but its my first try in JavaScript
16th May 2019, 2:41 AM
Hassan Alkholy
Hassan Alkholy - avatar