This project is archived and is in readonly mode.
data-confirm and data-method don't work together in Internet Explorer 8
Reported by lars (at pinds) | September 2nd, 2010 @ 05:48 PM
If you have this code:
<%= link_to "Click me", "javascript:alert('clicked')", :confirm => "Are you sure?", :method => :delete %>
Then in IE8, you'll first see the alert-box that says "clicked", then the confirm-box saying "Are you sure?".
Thus, the link gets clicked regardless of whether we click OK or Cancel in the confirm dialog.
Not good if the link is destructive (which it'll usually be if you're using the confirm box).
Comments and changes to this ticket
-
Jeff Kreeftmeijer November 7th, 2010 @ 04:53 PM
- Importance changed from to Low
Automatic cleanup of spam.
-
Yuval Kordov December 28th, 2010 @ 04:09 AM
I notice the jquery UJS is still using the following for confirms:
$('body').delegate('a[data-confirm], button[data-confirm], input[data-confirm]', 'click.rails', function () {
This was a response to a bug in JQuery 1.4.3 which has since been resolved in 1.4.4. It should be reverted to:
$('a[data-confirm],input[data-confirm]').live('click', function(e) {
-
Neeraj Singh December 29th, 2010 @ 08:42 PM
@Yuval Kordov : The change that you are proposing fixes the problem? Or was it just a comment in general.
Current version of jquery-ujs supports both jQuery 1.4.4 and jQuery 1.4.3 . We can drop the support for jQuery 1.4.3 if that change fixes the problem.
-
Utkarsh Kukreti December 30th, 2010 @ 04:25 PM
- Tag set to fixed
This was fixed in Prototype UJS, https://github.com/rails/prototype-ujs/issues/closed#issue/3
-
Neeraj Singh December 30th, 2010 @ 06:50 PM
Can someone confirm if this is an issue in jquery-ujs or not?
-
Yuval Kordov January 5th, 2011 @ 08:13 PM
Neeraj, I presented the delegate fix due to the JQuery 1.4.3 bug. When we upgraded to 1.4.4, the delegate call no longer worked, so we reverteds to the .live call with no further issue. Personally, I would suggest dropping support for 1.4.3 but I've obviously only tested within my own framework. Your mileage may vary.
-
Santiago Pastorino January 9th, 2011 @ 10:10 PM
- State changed from new to resolved
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>