I’ve got a tbody with id “serialTable” and wanting to write some table data into it via ajax .. so I’ve put this up
$(document).keyup(function(e) {
if(e.which == 13) {
$("#loader").html("<img src='/images/loaders/loader9.gif'>").fadeIn(400,function(){
var serialInput = $("#serial").val();
var data = 'scan=1&serial='+serialInput;
$.post('/ajax/delivery_scan.php', data, function(response){
$('#serial').val('').focus();
var new_div = $(response).hide();
$('#serialTable').append(new_div);
new_div.slideDown();
}
});
}
});
The idea is that on each and every keyup of “Enter” the serial in the text input field of “serial” will be processed into the table directly with the rest of the credentials. However, it seems to be none responding. I’ve been wondering if anyone in here could point me to what’s wrong. Thank you 🙂
Edited: Here’s the html for the table:
<div class="table">
<div class="head"><h5 class="iFrames">List of Serials/Products for Delivery to Site </h5></div>
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic">
<thead>
<tr>
<td width="20%">Serial</td>
<td width="20%">Product Name</td>
<td width="20%">Item Code</td>
</tr>
</thead>
<tbody id="serialTable">
</tbody>
</table>
</div>
Looks like you have a syntax error. You need to close
$.post()You should see an error in your console.