When I close the modal dialog, I want to stop the keystroke processing.
consider that I press the button and the sam () function is called.
function sam () {document.onkeypress = function (e) {processKeystroke (e); }}
So, now the function is tied to a keypress event. when a key is ever pressed, the processkeystroke function will be called. The sam function is called only after the modal dialog box is displayed.
Now I close the modal dialog and with this I do not want the function (e) {processKes ...} to be called.
What do I need to do to remove the connected event listener from the document. unkeypress.
Also, I would like to have alternatives for the above approach, because the one I took from myself and I did not refer to any specific documentation, so I really look through the trial and error procedure for using event handlers or listeners.
Therefore, when I call the sam function, I want the function to be bound to the key press event, and if I call another example of the form form closedialog (), I want the key listen function to be removed. Because I want to write the correct code, which should not consume a lot of system resources.
, .
document.onkeypress = null;
, , jquery, bind (attach) unbind ( detach) , keypress.
bind
unbind
keypress
Source: https://habr.com/ru/post/1762818/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1762813/converting-array-of-objects-to-array-of-arrays&usg=ALkJrhjsEqlbuIr7jgKWBHm6CVlEG2l57Qcan you give any asp.net control that doesn't display as html? - asp.netпочему мы используем исправление кода в asp.net? - asp.netIs it possible to use C # FtpWebRequest through an FTP proxy? - c #ejabberd: installed, users working added, but ejabberdctl not working - erlangjquery simplemodal plugin: a popup that scrolls from the page - scrollFind parent button dialog - androidPassing data from model to custom validation class - c #https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1762822/r-graphics-add-labels-to-stacked-bar-chart&usg=ALkJrhgfFZMb6yH8IE60fcFXqvayXeUrXQWhy doesn't the postal code go to the address dictionary? - objective-cAll Articles