Last active
May 30, 2023 15:00
-
-
Save jhowbhz/db998345b221e861ca8a1e5de2bf8766 to your computer and use it in GitHub Desktop.
example_ajax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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