我有一个SQLite数据库,其中包含一个包含9列的表。我希望每个列都可以在ui页面上搜索,而无需单击提交按钮。实际的UI表由jQuery加载到索引上,并且每10秒重新加载一次。
我认为可以通过每次更改输入框时将变量从表单传递到我的jQuery load()
函数(或者如果有人有任何建议更有效的方式),但我不知道如何要做到这一点 - 我正在考虑使用AJAX,但我不确定这样做的正确方法。显然我可以使用AJAX直接POST
或GET
到页面,但是10秒后表格会再次重新加载,我会丢失这些数据。
我的表格:
<form method="GET">
<th><input name="SSeries" class="form-control"></th>
<th><input name="SModel" class="form-control"></th>
<th><input name="SSerial" class="form-control"></th>
<th><input name="SColor" class="form-control"></th>
<th><input name="SStorage" class="form-control"></th>
<th><input name="SCarrier" class="form-control"></th>
<th><input name="SType" class="form-control"></th>
<th><input name="SUPC" class="form-control"></th>
<th><input name="SSTATUS" class="form-control"></th>
</form>
我的表加载jQuery
function showTable(){
$('#db').load('showTable.php',function () {
});
}