0
我有ID爲「serialTable」一個TBODY,並希望通過AJAX一些表中的數據寫入到它..所以我就把這件事jQuery的寫入TBODY
$(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();
}
});
}
});
的想法是,在「串行」的文本輸入字段中的「輸入」串行的每個鍵都將直接與其餘憑證一起處理到表中。但是,它似乎沒有迴應。我一直在想,如果有人在這裏可以指出我有什麼不對。謝謝:-)
編輯:下面是表的HTML:
<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>
新增的HTML內容。對於PHP返回,這只是「