What I'm looking for is the following: At the moment when the action is triggered to refresh the page, a message like this appears before me:
swal({
title: "Se perderan los datos",
text: "¿Desea refrescar la pagina?"
type: "warning",
showCancelButton: true,
confirmButtonText: "refrescar",
cancelButtonText: "Cancelar",
closeOnConfirm: true,
closeOnCancel: true,
}, function () {
//Cualquier cosa
});
But I do not know the event and its use. Thanks in advance.