---
title: "javascript  pop up window which is the same as current page"
author: "hb_keepmoving"
date: "2013-09-03T10:38:23Z"
tags: []
categories: ["Web前端"]
slug: "javascript-pop-up-window-which-is-the-same-as-current-page"
draft: false
lastmod: "2013-09-03T10:38:23Z"
id: 1935788
url: "https://hb-keepmoving.iteye.com/blog/1935788"
---

```
使用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();
```