关于window.open的问题

进击的小菜 2013-08-26 08:21:04
现在我需要打开一个新的窗口,并通过返回的变量来操作这个窗口。。
比如 var a=window.open(...)打开一个空的html文件
那么怎么通过操作返回的a来给这个空的html写入文本文档呢?
假设我的文本文档是通过创建request=new XMLHttpRequest(),然后根据request.responseText来获得的!本人是菜鸟!求高手指导啊!
...全文
95 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
街头小贩 2013-08-26
  • 打赏
  • 举报
回复
主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>

87,992

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧