Jquery search in json - Get json data code example
Example: Jquery search in json - Get json data
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$.getJSON("json1.json", function(result){
$.each(result, function(i, obj){
$("div").append(obj.first + " " + obj.last + " " + obj.desc + " " + "<br>");
});
});
});
});
</script>
</head>
<body>
<button>Get JSON data</button>
<div></div>
</body>
</html>