我正在尝试将数据表添加到我的弹出表内容中。
我有
var popup = window.open("popup.html", "popup","width=1000, height=600, scrollbars=yes");
popup.document.write(
$('#popupDataTable').dataTable( {
'bPaginate': false,
'bLengthChange': false,
'bFilter': true,
'bSort': true,
'bInfo': false,
'bAutoWidth': false,
'bDestroy':true
})
)
popup.document.write(
"<table id='popupDataTable'>"+
"<thead><tr><th>name</th><th>job</th><th>email</th><th>phone</th><th>address</th><th>gender</th></thead><tbody>")
//adding td data codes.....
popup.document.write("</tbody></table>");
但是,在我的弹出窗口中,我看到的只是
[object Object]
<table>
// my table contents display properly here, but datatable codes don't effect the table.
</table>
我的数据表 javascript 不会影响我的弹出窗口表。我该如何解决这个问题?非常感谢!