点击之后:
具体代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-widthh, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<input type="button" value="打开子窗口" onclick="makeNewWindow()">
<script>
function makeNewWindow(){
newWindow=window.open('','new','width=770,height=380');
newWindow.document.write("<img src='img/1.jpg'/>");
newWindow.document.body.style.margin=0;
newWindow.document.title="招标";
newWindow.focus();
newWindow.opener.document.write("这是父窗口");
}
</script>
</body>
</html>