首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

关于window.open的有关问题

2013-09-05 
关于window.open的问题现在我需要打开一个新的窗口,并通过返回的变量来操作这个窗口。。比如 var awindow.o

关于window.open的问题
现在我需要打开一个新的窗口,并通过返回的变量来操作这个窗口。。
比如 var a=window.open(...)打开一个空的html文件
那么怎么通过操作返回的a来给这个空的html写入文本文档呢?
假设我的文本文档是通过创建request=new XMLHttpRequest(),然后根据request.responseText来获得的!本人是菜鸟!求高手指导啊!
[解决办法]
主html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<script type="text/javascript">
var windowObjectReference;
var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,width=200px,height=200px";
windowObjectReference = window.open("http://www.apobates.com/openlab/demo.html", "CNN_WindowName", strWindowFeatures);

windowObjectReference.document.write ("hello world");
</script>
</body>
</html>

demo.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
</body>
</html>

热点排行