harvesthq/chosen — pull request #337 by carlocapocasa (2011-11-03 13:18:19+00:00)
Title: Keep javascript:void links from triggering onbeforeunload in IE

Hi, and thanks for making chosen!

If you use some kind of dirtyforms plugin, clicking on Chosen UI elements will cause the "leave page" handling code to be called.

This is because, apparently, links to javascript:void will trigger the onbeforeunload event in at least IE 6, 7 and 8.

I'm not sure what the Microsoft rationale is for this behavior :) but here's a quick fix (for jquery, doesn't break anything).

btw here's yeat another pretty example of the chosen forms: http://spendet.org/losgehts.html

Carlo