Código
function add_product(){ var code = $('#code').val(); var product = $('#product').val(); var price = $('#price').val(); var stock = $('#stock').val(); var valCheck = verificar(); if(valCheck == 1){ $.ajax({ url: '../Controllers/user.php', type: 'POST', data: 'code='+code+'&product='+product+'&price='+price+'&stock='+stock+'&boton=add_product' }).done(function(ans){ if(ans == 'success'){ $('#success').show().delay(2000).fadeOut(); }else{ alert(ans); } }) } else { } }