harvesthq/chosen — Issue #403: window beforeunload triggered from chosen click, IE 8 & 9
Author: digger69
Created: 2011-12-15 23:17:37+00:00
State: open

I am using sammy.js in my app and found that in IE8 and 9 it would sporadically stop working. I tracked it down today to chosen causing 'beforeunload' on window to be triggered when the dropdown is clicked. Sammy is bound to that and unloads itself. It's not clear to me what is causing beforeunload to trigger.

To reproduce, just open harvesthq.github.com/chosen test page in IE8 or 9, start developer tools (f12) and click 'start debugging' on script tab. In console bind to 'beforeunload':
$(window).bind('beforeunload', function() {alert('in before');});

and then click on any of the chosen dropdowns and see alert.

any help appreciated.