<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<p id="p1"></p>
</body>
<script type="text/javascript">
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function(){
if(this.readyState == 4 && this.status == 200){
var mydata = JSON.parse(xhttp.responseText);
document.getElementById("p1").innerHTML = mydata.name;
}
}
xhttp.open("get","data.json",true);
xhttp.send();
</script>
</html>
data.json
{
"name":"ccc"
}