【发布时间】:2016-01-23 00:42:01
【问题描述】:
我正在使用 jQuery 在输入更改时刷新表中的一行。这是我行的基本 html:
<tr id="TestCaseNameDataRow">
<td><input value="some value that will be refreshed"></td>
<td><select></select></td> // select that gets populated based on the above input
</tr>
这是我刷新表格行的javascript:
$j('#TestCaseNameDataRow').load(window.location.href.split('?')[0] + ' #TestCaseNameDataRow', function(){
// callback function
});
但是,加载完成后,我的 html 看起来像这样:
<tr id="TestCaseNameDataRow">
<tr id="TestCaseNameDataRow">
<td><input value="some value that will be refreshed"></td>
<td><select></select></td> // select that gets populated based on the above input
</tr>
</tr>
为什么.load() 将表格行加倍?我该如何阻止它?它让我的桌子看起来很不好看。
【问题讨论】:
标签: javascript jquery html load html-table