44 lines
919 B
HTML
44 lines
919 B
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Lab8 Task 3b</title>
|
|
<link rel="stylesheet" type="text/css" href="css/Lab08_Q3_layout.css">
|
|
<script src="jquery/jquery-2.1.4.js"></script>
|
|
<script>
|
|
$(document).ready(function(){
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: 'Lab08_3a.php',
|
|
dataType: 'json',
|
|
success: function(result){
|
|
$.each(result.part, function(key, value){
|
|
$('tbody').append($('<tr>')).append($('<td>').text(value.item)).append($('<td>').text(value.manufacturer)).append($('<td>').text(value.model)).append($('<td>').text(value.cost));
|
|
|
|
|
|
});
|
|
},
|
|
error: function(err){
|
|
console.log("error" + err);
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<h2>Table of Computer Parts</h2>
|
|
<table id="tableID" border="1">
|
|
<thead>
|
|
<tr>
|
|
<th>Item</th>
|
|
<th>Manufacturer</th>
|
|
<th>Model</th>
|
|
<th>Cost in $</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
</tbody>
|
|
</table>
|
|
</body>
|
|
</html>
|