Created
August 3, 2019 22:58
-
-
Save irwingb1979/d26f3ae9708e53c3bd6ff28db0087ea0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Se ejecuta cuando hay un archivo | |
$('#guardar-registro-archivo').on('submit', function(e) { | |
e.preventDefault(); | |
var datos = new FormData(this); | |
// console.log(datos); | |
$.ajax({ | |
type: $(this).attr('method'), | |
data: datos, | |
url: $(this).attr('action'), | |
dataType: 'json', | |
contentType: false, | |
processData: false, | |
async: true, | |
cache: false, | |
success: function(data) { | |
console.log(data); | |
var resultado = data; | |
if(resultado.respuesta == 'exito') { | |
swal( | |
'Good job!', | |
'You clicked the button!', | |
'success' | |
) | |
} else { | |
swal( | |
'Oops...', | |
'Something went wrong!', | |
'error' | |
) | |
} | |
} | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment