0
我想在新选项卡而不是新窗口中打开我的打印屏幕选项。在新选项卡中打开用于打印目的
这里是我的javascript代码
$scope.PrintWindow = function(divName,method) {
var printContents = document.getElementById(divName).innerHTML;
var popupWin = window.open('Print', method, 'fullscreen=yes');
popupWin.document.open()
popupWin.document.write('<html><head><link href="print.css" rel="stylesheet" type="text/css" media="print"></head><body onload="window.print()">' + printContents + '</html>');
popupWin.document.close();
popupWin.focus();
}
_self在同一窗口中打开
_target和_newtab在新窗口中打开。我希望它在新标签中。
您不能强制一个新的选项卡,而不是新的窗口,因为它取决于浏览器和可能的用户设置。 – Archer
这已被讨论http://stackoverflow.com/questions/15818892/chrome-javascript-window-open-in-new-tab –
我正在使用全屏=是,这是总是打开一个新的窗口。感谢努力。 –