0
我想打印一張表,但我卡住了。打印表與vb和javascript
表名:電網2,使用asp.net & VB
這是我的代碼,但因此它會打開404
function printTable() {
var printContent = document.getElementById("grid2");
var windowUrl = 'about:blank';
var num;
var uniqueName = new Date();
var windowName = 'Print' + uniqueName.getTime(); var printWindow = window.open(num, windowName, 'left=50000,top=50000,width=0,height=0');
printWindow.document.write(printContent.innerHTML);
printWindow.document.close();
printWindow.focus();
printWindow.print();
printWindow.close();
}
<p><input type="button" value="Yazdır" onClick="printTable();"></p>