ITeye博客

javascript pop up window which is the same as current page

hb_keepmoving · 2013-09-03 10:38 · javascript · Web前端 · Markdown

使用window.open 打开一个和当前页一样内容的窗口。

 

var printPreview = window.open('',"_blank","status=0,toolbar=0,location=0,menubar=0,directories=0,scrollbars=1,resizable=1")
	var printDocument = printPreview.document;
	printDocument.open();
	var html = document.documentElement.innerHTML;
	printDocument.write("<html>"+html +"</html>");
	printDocument.close();

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。