Side navigation
#14791 closed bug (fixed)
Opened February 13, 2014 12:37PM UTC
Closed March 05, 2014 02:50AM UTC
Triggering beforeunload throws exception
Reported by: | fejesjoco | Owned by: | dmethvin |
---|---|---|---|
Priority: | low | Milestone: | 1.11.1/2.1.1 |
Component: | event | Version: | 1.11.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The following code:
$(window).on("beforeunload", function() { return "nooooooo"; }); $(window).triggerHandler("beforeunload");
Result in an error: TypeError: event.originalEvent is undefined
Attachments (0)
Change History (5)
Changed February 13, 2014 02:26PM UTC by comment:1
Changed February 13, 2014 02:34PM UTC by comment:2
I checked out the offending lines, I see there's some kind of magic converting between browser-native and jQuery event objects. Please make sure there is some way to find out the result of the beforeunload handler, because that's the whole purpose of triggering the event manually. (I am putting an iframe inside a dialog. When closing the dialog, I want to check if the loaded page lets me do that.)
Changed February 24, 2014 03:15PM UTC by comment:3
component: | unfiled → event |
---|---|
milestone: | None → 1.11.1/2.1.1 |
priority: | undecided → low |
status: | new → open |
Changed March 04, 2014 03:21AM UTC by comment:4
owner: | → dmethvin |
---|---|
status: | open → assigned |
http://jsfiddle.net/zCGfY/