T
T
Tato2014-11-27 05:34:17
JavaScript
Tato, 2014-11-27 05:34:17

jquery ajax not working in IE 11?

Good afternoon.

We have such a handler:

$.ajax({
            type: 'POST',
            dataType: 'json',
            async: false,
            cache: false,
            url: form.attr('action'),
            data: form.serialize(),
            success: function(response){
                if (response.ok) {
                    form.submit();
                } else {
                    alert('VALIDATION FAIL');
                }
            },
            error: function(xhr, str){
                alert('ERR: ' + xhr.responseCode);
            }
        });


In IE 11 we get into error all the time, but at the same time responseCode = undefined.
We are trying to serialize to see what kind of object.
...
error: function(xhr, str){
    alert('ERR: ' + xhr.serialize());
}

Everything works fine, i.e. we go to success.

Attention to the question, how so? Why does serialize() make everything work normally?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Tato, 2014-11-27
@Tato

Issue resolved. You need to remove the url parameter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question