jquery.AreYouSure icon indicating copy to clipboard operation
jquery.AreYouSure copied to clipboard

Click on the anchor tag will popup the message in IE

Open sk29110 opened this issue 11 years ago • 3 comments

If you have anchor tag with href="jquery:void(0)" in the form and click on the anchor tag it will generate beforeunload event. I hope we can have some kind of workaround so that it doesn't do that on IE9/10

sk29110 avatar Jun 03 '13 23:06 sk29110

Is that an anchor to submit the form? Are you able to post some example code so I can better understand the issue.

codedance avatar Jun 03 '13 23:06 codedance

I set up the test page on my site. http://skoizumi.com/areyousure/ you will see on chrome/firefox it doesn't bring up the "are you sure" dialog when click on "just popup" but in IE9/10 after "hello" you will see the "are you sure" dialog. I wonder if we can make some kind of workaround within the plugin.

sk29110 avatar Jun 04 '13 04:06 sk29110

Thanks for the existing code. I now understand.

There is an IE issue/bug. It's raising the "onbeforeunload" event even though the links do not cause browser to leave the exiting page. The only easy solution I can see is to use href="#" instead. It's discussed in this Stack Overflow article:

http://stackoverflow.com/questions/7263309/onbeforeunload-event-is-too-enthusiastic-in-ie9

I can't think of a way to address this within the AreYouSure plugin itself (other than say automatically rewriting your href="javascript:void(0)" links for you).

codedance avatar Jun 06 '13 08:06 codedance