How to add .json file in html document.
I tried like this ,but not got output
array.json file
var employees = [
{
"firstName":"John",
"lastName":"Doe"
},
{
"firstName":"Anna",
"lastName":"Smith"
},
{
"firstName":"Peter",
"lastName":"Jones"
},
];
employees[0].firstName="Gilbert";
document.getElementById("demo").innerHTML =
employees[0].firstName + " " + employees[0].lastName;
abc.html file
<!DOCTYPE html>
<html>
<head>
<script src="array.json"></script>
</head>
<body>
<h2>Create a JavaScript Object</h2>
<p id="demo"></p>
</body>
</html>