---
title: "父窗体，子窗体"
author: "陈先森"
date: "2014-07-21T11:14:22Z"
tags: []
categories: ["Web前端"]
slug: "untitled"
draft: false
lastmod: "2014-07-21T11:14:22Z"
id: 1984378
url: "https://zhanchan.iteye.com/blog/1984378"
---

&lt;script type="text/javascript"&gt;// &lt;!\[CDATA\[ function abc() { window.open('b.htm','new','width=200,height=100'); } // ]]&gt;&lt;/script&gt;

 

```
<html>
<head><title></title>
<script type="text/javascript">
function abc()
{
    window.open('b.htm','new','width=200,height=100');
 
}
</script>
</head>
<body>
<a href="#" onclick="abc()" >点击链接</a>
</body>
</html>
 
B:b.htm
<html>
<head><title></title>
<script type="text/javascript">
window.opener.location.href="http://www.baidu.com"
</script>
</head>
<body>
<a href="#">点击链接2</a>
</body>
```

[](#)