Hey Im a begginer when it comes to new age html code (i consider json and javascript code new age, because i learned on just straight html code). Well What im doing is trying to get all the data from my .json file and put in a table, but it keeps saying i cannot load resource and it says the .json file.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" charset="text"> </meta>
<title> - Jason Onto HTML Displayed</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#DisplyEmp").click(function() {
$.getJSON("Localhost/Homework_1_second_attempt.json", function(data) {
for(emp in data.albums) {
console.log(data.albums[emp]);
var newRow = "<tr>"+
"<td>"+data.albums[emp].title+"</td>"+
"<td>"+data.albums[emp].artist+"</td>"+
"<td>"+data.albums[emp].songs+"</td>"+
"</tr>";
$("#EmpNewTable").append(newRow);
}
});
});
});
</script>
</head>
<body>
<table id="EmpNewTable" border="2">
<tr>
<th>Artist</th>
<th>Title</th>
<th>Songs</th>
</tr>
</table><br /><br />
<input type="button" id="DisplyEmp" value="Display" />
</body></html>
thank you everyone for helping me with my problem