<!DOCTYPE html>
<html lang="en-US">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<body>
<h1>jQuery getJSON() Method</h1>
<p>Click on the button and check your console.</p>
<button>Click Me</button>
<script>
$(document).ready(function(){
$("button").click(function(){
$.getJSON("/data.json", function(data){
console.log(data);
});
});
});
</script>
<p><strong>Note</strong>: JSON file used in this example is <a href="/data.json" target="_blank">data.json</a></p> </body>
</html>