Refresh the page while deleting

0

I have this function to create an alert before deleting and I 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 you delete the line. How do I delete a line when I refresh the page?

    
asked by anonymous 19.11.2018 / 16:40

2 answers

2

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.

    
19.11.2018 / 16:49
1

Within the function ConfirmDelete () you can enter the following:

location.reload(true);

The 'true' flag serves to reload the page with the server version, if you leave without the parameter true, it will get the last cached version.

    
19.11.2018 / 16:49