Calling API in Jquery

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$.get("api.php", function(data, status){
console.log(status);
console.log(data);
});
});
});
</script>
</head>
<body><button>Send an HTTP GET request to a page and get the result back</button>

</body>
</html>

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *