Keypress icon indicating copy to clipboard operation
Keypress copied to clipboard

TypeError: window.keypress is undefined

Open YTCuber opened this issue 7 years ago • 3 comments

When I load the Keypress script in my own site or even on https://dmauro.github.io/Keypress/, it does not work at all.

Browser: Firefox Quantum 60.0.1 (64 bit) OS: Ubuntu 17.10

Error messages: TypeError: window.keypress is undefined in main.js:5:3 Trace: @https://dmauro.github.io/Keypress/js/main.js:5:3 @https://dmauro.github.io/Keypress/js/main.js:2:2

YTCuber avatar May 25 '18 19:05 YTCuber

@YTCuber Any solution on this ? same error occurring for me

akhzarjaved avatar Dec 19 '20 11:12 akhzarjaved

Same problem for me: window.keypress is undefined

mangru avatar Jan 13 '21 09:01 mangru

Hi.

Not sure if you have already tried this but in my case it was a silly mistake.

In my HTML code I was loading my own JS file -from where I was trying to use keypress- before loading keypress.js itself.

<script src='js/myFile.js'></script> <script src='js/keypress.js'></script>

I moved the reference to keypress.js to the top

<script src='js/keypress.js'></script> <script src='js/myFile.js'></script>

and that was it.

Hope this helps.

Same problem for me: window.keypress is undefined

jjuambel avatar Jan 13 '21 18:01 jjuambel