It worked, but now I get:
window.event is undefined
From this simple code that worked:
function checkKey() { if (window.event.keyCode != 9) { document.actionForm.saveStatus.value = "Not saved"; } }
Why can't I use window.event anymore?
window.event is a proprietary Microsoftism.
window.event
The standard way to access event data is through the first argument of the event handler function.
function checkKey(e) { var evt = e || window.event, keyPressed = evt.which || evt.keyCode; if (keyPressed != 9) { document.actionForm.saveStatus.value = "Not saved"; }
You can standardize the check as follows:
function checkKey(e) { var evt = e || window.event; if (evt.keyCode != 9) { document.actionForm.saveStatus.value = "Not saved"; } }
Source: https://habr.com/ru/post/956455/More articles:Flask Mega Tutorial - jinja2.exceptions.UndefinedError: 'form' undefined - pythonUsing an existing library in symfony - phpFacebook Authentication with Passport and ExpressJS - Why is callback verification not called? - node.jsPayPal REST API does not accept configured delivery address - paypalHow to force input for alpha letters only? - javascriptOptimization Methods - performanceHow to fix broken submodule configuration in git? - githow to use DISTINCT here in my query CODEIGNITER - phpHow to get rid of W11 when compiling latex using vim-latex-suite - vimCommondatastorage v / s storage request endpoints - google-cloud-storageAll Articles