1
The following code works perfectly in the Windows 10 Browser, but it doesn’t work in the Android/IOS mobile browser completely and in Macos gives a message telling the user that it is not working well. The problem seems to be in: success: function(result)
.
The rest of the code works, the only thing is it doesn’t work is div $('#warning'), so I tested it in isolated parts. When executed in parts works, but is within the full code not.
$(function () {
$("form[name='form-inscricao']").submit(function(e){
e.preventDefault();
var $form = $(this);
var $inputs = $form.find("input, select, button, textarea");
var serializedData = $form.serialize();
$inputs.prop("disabled", true);
$.ajaxSetup({
contentType: "application/x-www-form-urlencoded; charset=UTF-8"
});
$.ajax({
url:'https://www.example.com/wp-content/themes/example.com/enviar.php',
type: 'post',
dataType: 'html',
data: serializedData,
async: false,
beforeSend: function(){
$('.loader').show();
$('#aviso').text('');
},
error: function() {
console.log('Something went wrong');
},
success: function(result){
$('#aviso').append(result).css({opacity:1.0}).delay(1000).animate({opacity : 0},500);
},
complete: function(){
$('.loader').hide();
$form.get(0).reset();
$inputs.prop("disabled", false);
}});
});
});
This is Stackoverflow in English, please translate your question, or move to Stackoverflow in English.
– NoobSaibot
You edited the question to be in English, but now the problem is unclear. Set "not working".
– Oralista de Sistemas
It may be other plugins or scripts before this, please give details.
– Guilherme Nascimento