Good afternoon, I have the following code:
function desactivar(idcategoria)
{
swal({
title: "Desactivar Categoría",
text: "¿Está Seguro de desactivar la Categoría?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Si,desactivar!",
closeOnConfirm: false
},
function(result){
if (result) {
$.post("../ajax/categoria.php?op=desactivar",{idcategoria : idcategoria},function(e){
swal("Desactivado!",e, "success");
tabla.ajax.reload();
});
}
});
}
But when you press the button that executes the function, this appears:
Uncaught SweetAlert: Unexpected 2nd argument
I do not know exactly how to solve it, could you please help me?
Thank you!