0

<solved>Compatibility issues?(android)

So I wrote this code and everything works just fine on my iPhone but when I testet it on android (I wanted to see how it looks on a different screen size) it showed me an error message. The error: "Uncaught TypeError: Cannot read properties of null (reading 'getContext') Line: 4" Can anybody explain what is happening and how I can fix this? https://code.sololearn.com/W74ue81u1ssd/?ref=app

29th Jan 2022, 7:33 AM
Lukas Threis
2 Answers
+ 1
https://code.sololearn.com/W9eNFfSdrEOG/?ref=app You should add before your code starts: window.onload=function(){ And close the curly braces at the end. }
29th Jan 2022, 8:04 AM
Mohammed
+ 1
Thank you that worked šŸ‘
29th Jan 2022, 11:28 AM
Lukas Threis