经过漫长的一天后,我的大脑被煎炸了,本周末被分配了一项任务,即使用 jquery 在我们的 UI 中插入一个表格。
我有一些大而丑陋的代码行正在插入 html 元素......想看看是否有一种简单的方法可以使这个更干净。我知道我可以把它分成几行,但必须有一个最佳实践:
$('#submitNewTiers').bind('click',function (e) {
$('<div class="tiersTables"><span><a href="" rel="#overlay">Edit Tiers </a></span><table class="visible" id="newTiersTable"><thead&gr;<tr><th>Range</th><th>List Price</th><th>Quote Price</th><th class="lastTh">Approval?</th></tr></thead></table></div>').insertAfter('div.tiersTables');
$('<tbody><tr><td>HERE</td><td></td><td></td><td></td></tr></tbody>').insertAfter('#newTiersTable thead');
return false;
});