Created
November 23, 2020 08:43
-
-
Save burakcanekici/8bc61bdf43ac9fdb1e7477c904bbef05 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 lang="en"> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
$("#get").click(function(){ | |
$.get("http://localhost/services/pokemon", function(data, status){ | |
console.log(data); | |
$("#list").empty(); | |
$("#list").append(data); | |
}); | |
}); | |
$("#post").click(function(){ | |
$.post("http://localhost/services/pokemon", function(data, status){ | |
console.log(data); | |
$("#list").empty(); | |
$("#list").append(data); | |
}); | |
}); | |
}); | |
</script> | |
<meta charset="utf-8"> | |
<title>Pokedex</title> | |
</head> | |
<body> | |
<h2>Hello from Nginx container</h2> | |
<button id="get">Get all pokemons</button> | |
<button id="post">Add Squirtle to list</button> | |
<p id="list"></p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
index