+ 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
3 RĂ©ponses
+ 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.
+ 3
Thank you man it works đ
+ 2
I know the code might look annoying but its my first try in JavaScript