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.