0

Not visualizing JS

Hi, I made this code on Notepad++ (and it works) and I wanted to publish it here to share it easily but when I copy-pasted it here, it didn't work. I tried to switch 'let' with 'var' but anything changes. Anyone have ideas? https://code.sololearn.com/WXniqRd0QbTA/?ref=app Thanks Alessio

10th Oct 2017, 10:14 PM
Alessio Giliberti
4 odpowiedzi
+ 9
<!DOCTYPE html> <html> <head> </head> <body> <h1 align="center">Counters</h1> <script> "use strict"; //Canvas Declaration var canvas = document.createElement('canvas'); document.body.appendChild(canvas); var ctx = canvas.getContext("2d"); //...your code... canvas.addEventListener('click', mouseClick); </script> </body> </html> <!-- It works but need improvements in mouse positioning. -->
10th Oct 2017, 11:07 PM
K137(){/**/};
K137(){/**/}; - avatar
0
Doesnt work code in SL in mobile, SL in PC or both?
10th Oct 2017, 10:22 PM
Daniel
Daniel - avatar
0
@Наталья Ошуркова I knew that the mouseClick pos was relative to the window and not to canvas but I didn't know how to solve it so thanks a lot!
11th Oct 2017, 1:11 PM
Alessio Giliberti
0
@Daniel Fernández Hidalgo Both
11th Oct 2017, 1:11 PM
Alessio Giliberti