Skip to content

Instantly share code, notes, and snippets.

@burakcanekici
Created November 23, 2020 08:43
Show Gist options
  • Save burakcanekici/8bc61bdf43ac9fdb1e7477c904bbef05 to your computer and use it in GitHub Desktop.
Save burakcanekici/8bc61bdf43ac9fdb1e7477c904bbef05 to your computer and use it in GitHub Desktop.
<!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>
@burakcanekici
Copy link
Author

index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment