Ajax does not return callback in IOS

0

I'm having the following problem, when I try to run my code it arrive in beforeSend however it does not return me if an error has occurred or was successfully executed, could someone help me with this. On PC and Android it works normally and does the redirection and even shows the error when it happens.

event.preventDefault();

var formData = new FormData($(this)[0]);

//$("#stepTwoForm button[type=submit]").attr('disabled', 'disabled');
$('#alertError').hide();

clearColorFields();

$.ajax({
    type: "POST",
    url: "/app/cadastro/passo3-store",
    async: true,
    cache:false,
    data: formData,
    contentType: false,
    processData: false,
    dataType: 'json',
    beforeSend: function(){
        alert('enviou');
    },success: function (data) {
        if (data.url) {
            window.location.href = data.url
        }
    },
    error: function (data) {
        $("#stepTwoForm button[type=submit]").removeAttr('disabled');
        $('.loader').css('visibility', 'hidden').css('opacity', '0');
        $('#stepTwoForm button[type=submit]').css('visibility', 'visible').css('opacity', '1').css('height', '40px');
        $('#alertError').html(data.responseJSON.messages);
        $('#alertError').show();
        alertRequests('error', data.responseJSON.messages, 'alertStoreProvider');
        colorRequiredFields(data.responseJSON.fields);
    }
});
    
asked by anonymous 13.04.2018 / 21:37

0 answers