问题
I'm currently working with jQuery 1.4.2 and jQuery UI 1.8.2.
I'm experiencing some weird behavior after I have closed a modal dialog. When I try to reload the page with Ctrl+F5 nothing happens. Another weird thing is that the context menu of Firefox can only be opened with right clicking twice.
The Firebug console is showing me the following message when I press the Ctrl key: The ‘charCode’ property of a keydown-event should not be used. The value is meaningless.
Demo page: http://testing.allinonesoftware.com/jquery/index.php
Luke
回答1:
This is the intended behavior...however there is a browser difference here. Firefox is not focusing inside your dialog on open.
If you click outside the modal and try F5 in any other browser, same effect, no refresh.
Also, if you click inside the modal with Firefox, your F5 will work.
To make this behavior consistent across browsers, focus the element you're making the dialog on open, or if you want, focus one of the buttons...either will have the same effect, as long as the keypress goes inside the dialog.
For the error message:
The ‘charCode’ property of a keydown-event should not be used. The value is meaningless.
This is just how jQuery does some things, you can ignore it...it has no impact on your current issue.
来源:https://stackoverflow.com/questions/2608346/jquery-dialog-blocks-firefox-hotkeys