JQuery

JQuery: window location href

Exemplo simples de redirecionamento de página ao clicar em uma tag do tipo button.

<html>
<head>
<script type="text/javascript" 
             src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript">
   $(document).ready(function() {
      $("#btn-voltar").click(function(){ 
         window.location.href="nome_da_pagina.php"; 
      }); 
});		
</script>	
</head>
<body>
   <button type="button" id="btn-voltar">Acessar página</button>
</body>
</html>

One thought on “JQuery: window location href

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *