Close ModalWindow on keypress
问题 I would like to be able to close a ModalWindow when the user presses a key, in my case ESC. I have a Javascript listener for the keypress which calls the click event of the cancel button's ID: jQuery("#"+modalWindowInfo.closeButtonId).click(); Is this the correct way to do it? I am wondering because it works in Chrome but not in FF, but it could be due my specific implementation. 回答1: The 'right' way to do it is to call the server, then close it with the response. You can do this with an ajax