How to display values from php page in html table using JQUERY.
I write two programs 1)php 2)jquery
but I do’nt know how to displays values in html table using jquery;
this are two programs
PHP PAGE data retrived from database
"; } ?>
JQUERY PAGE SHOWING VALUES IN AJAX TABLE
<script>
function getdetail()
{
val1=$("#nam").val();
:D $.ajax({
url:"test_c.php",
type:"POST",
data:{waybillval:val1},
context:document.body,
success:function(resp){
//var res = resp.split("-");
var row = $("<tr></td><td>"+resp+"</td></tr>");
$("#tbldata").append(row);
$("#msg").hide();
},
beforeSend: function() {
$("#msg").html("Please wait data is retriving...");
},
error: function(){
//alert('error');
}
});
}
</script>
</head>
<body>
<div>TODO write content</div>
<form>
<input type="text" id="nam" >
<input type="text" id="nam1">
<input type="button" value="submit" onclick="getdetail();">
<div id="msg"></div>
<table id="tbldata" border="5">
<tr>
<th>ticket_id</th>
<th>Waybill_no</th></tr>
</table>
</form>
</body>