Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

data-confirm and data-method don't work together in Internet Explorer 8

#5536

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).

Reported by lars (at pinds) · September 2nd, 2010 @ 05:48 PM

State: resolved
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Jeff Kreeftmeijer
    Jeff Kreeftmeijer
    • Importance changed from to Low

    Automatic cleanup of spam.

    November 7th, 2010 @ 04:53 PM

  2. Jeff Kreeftmeijer
  3. Yuval Kordov
    Yuval Kordov

    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) {
    

    December 28th, 2010 @ 04:09 AM

  4. Neeraj Singh
    Neeraj Singh

    @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.

    December 29th, 2010 @ 08:42 PM

  5. Utkarsh Kukreti
  6. Neeraj Singh
    Neeraj Singh

    Can someone confirm if this is an issue in jquery-ujs or not?

    December 30th, 2010 @ 06:50 PM

  7. Utkarsh Kukreti
    Utkarsh Kukreti

    It works fine on jquery-ujs.

    December 30th, 2010 @ 07:00 PM

  8. Yuval Kordov
    Yuval Kordov

    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.

    January 5th, 2011 @ 08:13 PM

  9. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to resolved

    January 9th, 2011 @ 10:10 PM