Form: remote => true, doesn't work in IE?

- form_for (@post,: remote => true,: id => 'post_form') do | f |

It works as expected in FF and Chrome, but IE just handles the submit action, usually without any ajax request.

I don’t see any information about this in the rest of the Internet, so I think I somehow did something wrong. Ive used both rails.js by default and the jquery version from github page

+3
source share
2 answers

Well, I don’t know why the default version for rails does not work for me on IE, but I wrote this as a workaround:

if ($ .browser.msie) {
    var form = $ ('form # new_post');
    form.find ('input # post_submit'). bind ('click', function () {
        var data = form.serializeArray();
        $.ajax({url: '/posts', type: 'POST', data: data});
        return false
    });
}

. rails.js - , Rails, , - ?

+5

Rails 3 , data-remote, AJAX , jquery-rails 1.0.19. IE7 jquery.js - , 1.7.1 jQuery. jquery-rails 1.0.18 .

+1

Source: https://habr.com/ru/post/1790285/


All Articles