window.opener()方法

简介: 菜鸟教程(runoob.com)function openWin(){ myWindow=window.open('','','width=200,height=100'); myWindow.document.

<!DOCTYPE html>
<html>
<head>
<meta charset="GBK">
<title>菜鸟教程(runoob.com)</title>
<script>
function openWin(){
myWindow=window.open('','','width=200,height=100');
myWindow.document.write("<p>这是我的窗口</p>");
myWindow.focus();
myWindow.opener.document.write("<p>这个是源窗口!</p>");
}
</script>
</head>
<body>

<input type="button" value="打开我的窗口" onclick="openWin()" />

</body>
</html>

相关文章
|
20天前
|
存储 安全 开发者
|
3月前
|
API
解决http下navigator.clipboard为undefined问题
总之,要解决 `navigator.clipboard`为 `undefined`的问题,你需要确保遵循浏览器的安全策略,使用HTTPS,获得用户授权,并在受信任的上下文中使用clipboard API。此外,还要确保你的代码在支持该API的浏览器上运行。如果问题仍然存在,可能需要进一步调查特定浏览器和环境的问题。
292 3
|
9月前
window.location对象使用
window.location对象使用
46 0
|
前端开发
前端 window 和 window.location
前端 window 和 window.location
前端 window 和 window.location
|
JavaScript
JS中window的parent和opener对象
JS中window的parent和opener对象
166 0
|
JavaScript 前端开发 数据格式