---
title: "javascript 弹出包含 html 元素的内容"
author: "sunzeping"
date: "2014-02-14T16:56:01Z"
tags: []
categories: ["Web前端"]
slug: "javascript-html"
draft: false
lastmod: "2014-02-14T16:56:00Z"
id: 2017179
url: "https://sunzeping.iteye.com/blog/2017179"
---

&lt;script type="text/javascript"&gt;  
    var myWindow=window.open('','','width=200,height=100');  
    myWindow.document.write("This is 'myWindow'");  
    myWindow.focus();  
    myWindow.opener.document.write("This is the parent window");  
&lt;/script&gt;

 

用以上代码代替 alert(xml.responseText); 可以很清楚地在js 代码里看到错误信息；

![](http://dl2.iteye.com/upload/attachment/0093/8339/67d7dd60-a793-3606-b422-766be9e41ad9.jpg)