Skip to content

Instantly share code, notes, and snippets.

@jhowbhz
Last active May 30, 2023 15:00
Show Gist options
  • Save jhowbhz/db998345b221e861ca8a1e5de2bf8766 to your computer and use it in GitHub Desktop.
Save jhowbhz/db998345b221e861ca8a1e5de2bf8766 to your computer and use it in GitHub Desktop.
example_ajax
<!DOCTYPE html>
<html>
<title> TESTE AJAX </title>
<body>
<button>CLIQUE AQUI</button>
<div id="teste"> </div>
</body>
</html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$("button").click(function(){
$.post("pagina.php", function(data, status){
$('#teste').html(data) // escreve o restorno dentro da div
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment