Refresh page when deleting

Asked

Viewed 34 times

0

I have this function to create an alert before deleting and call it on the button:

function ConfirmDelete() {
  return confirm("Tem certeza de que deseja excluir esta Requisição?");
}
<button type="submit" class="btn btn-danger" Onclick="return ConfirmDelete()">Excluir</button>

Works correctly, but does not refresh the page when deleting the line. How do I delete a line, refresh the page?

2 answers

1

Within the Confirmdelete() function you can insert the following:

location.reload(true);

The 'true' flag serves to reload the page with the server version, if you leave the true parameter out, it will take the latest cached version.

0


To refresh the page you can use

function ConfirmDelete() {
 location.reload();
 return confirm("Tem certeza de que deseja excluir esta Requisição?");
}

Maybe this will solve your problem if you just refresh the page.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.