为什么每当我追加了新的骨干以一个HTML元素,它会自动围绕着这一观点与<div> </div>
?
比如我有一个表在我的HTML页面
<table class="table table-hover">
<thead>
<tr>
<th>Column1</th>
<th>Column2</th>
</tr>
</thead>
<tbody id="tbl">
</tbody>
</table>
现在在我的骨干控制器,I执行以下
$("#tbl").append(new tblview().render().el);
,并在实际视图的HTML模板我有
tblview.html
<tr>
<td>entry3</td>
<td>entry4</td>
</tr>
现在,当我看这个浏览器,并检查HTML元素..它呈现这样的:
<table class="table table-hover">
<thead>
<tr>
<th>Column1</th>
<th>Column2</th>
</tr>
</thead>
<tbody id="tbl">
<div>
<tr>
<td>entry3</td>
<td>entry4</td>
</tr>
</div>
</tbody>
</table>
并因此成为所有脱节?我该如何解决这个问题? 我希望它能够在表格中显示没有这些额外<div> </div>
的视图。
也http://stackoverflow.com/questions/9982785/when-extending-a-backbone-view-is-there-a-way-to-not-render-a-tagname –
和HTTP ://stackoverflow.com/questions/11195242/extra-wrappers-in-backbone-and-marionette –
this one too http://stackoverflow.com/questions/13601966/how-to-avoid-template-wrapping-with-空中div-in-backbone –