<script type="text/javascript">
$(document).ready(function(){
console.log($('#list_table_template').html());
});
</script>
<div id="list_table_template" style="display: none;">
<table id="list_table" cellpadding="0" cellspacing="0">
<p>123</p>
<tr id="lt_header">
<!--#lt_header#-->
</tr>
<!--#lt_listing#-->
<tr id="lt_footer">
<td colspan="5">Footer Placeholder</td>
</tr>
</table>
</div>
このコードは期待どおりの結果を返しません。
ログが表示されることを期待していましたが:
<table id="list_table" cellpadding="0" cellspacing="0">
<p>123</p>
<tr id="lt_header">
<!--#lt_header#-->
</tr>
<!--#lt_listing#-->
<tr id="lt_footer">
<td colspan="5">Footer Placeholder</td>
</tr>
</table>
しかし、代わりにそれは私に与えます:
<p>123</p><table id="list_table" cellpadding="0" cellspacing="0">
<tbody><tr id="lt_header">
<!--#lt_header#-->
</tr>
<!--#lt_listing#-->
<tr id="lt_footer">
<td colspan="5">Footer Placeholder</td>
</tr>
</tbody></table>
p タグが順不同で、テーブルの前にジャンプすることに注意してください。