update,
This commit is contained in:
43
_resources/it114105/itp4513/Lab08/Lab08_3b.html
Normal file
43
_resources/it114105/itp4513/Lab08/Lab08_3b.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<!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>
|
Reference in New Issue
Block a user