How to know that called the screen

Asked

Viewed 55 times

2

I have two screens List and Filter, both are redirected to a third screen called Visualise:

Button View from the screen List:

//ABRE TELA VISUALIZAR
$(document).on('click', '.visualizar', function(e) {
  e.preventDefault;
  var pClienteID = $(this).attr("data-id");
  window.location.href = "/Administrativo/Cliente/Visualizar?pClienteID=" + parseInt(pClienteID);
});
//FIM

Button View from the screen Filter:

//ABRE TELA VISUALIZAR
$(document).on('click', '.visualizar', function(e) {
  e.preventDefault;
  var pClienteID = $(this).attr("data-id");
  window.location.href = "/Administrativo/Cliente/Visualizar?pClienteID=" + parseInt(pClienteID);
});
//FIM

Question: How to implement the button Come back screen Visualise?

  • 2

    I found a similar topic here at Stackoverflow, it might help: http://answall.com/questions/70611/script-para-voltar-para-a-p%C3%A1gina-previous-updated

2 answers

1


You can implement this button in two ways by creating the button and in the use click event:

window.location.href = '/Administrativo/Cliente/Listar'

To redirect to your action, or you can use history.go(-1) to return to previous page:

<input type="button" value="Back" onclick="history.go(-1);" />

0

You can use this script

<script>
function goBack() {
    window.history.back()
}
</script>

and call him on his button

<input type="button" value="Back" onclick="goBack()">

Example:

function goBack() {
    window.history.back()
}
<input type="button" value="Voltar" onclick="goBack()">

Browser other questions tagged

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