您的位置:首页 > 运维架构

子页面是父页面通过window.open弹出

2016-04-25 11:47 453 查看
1.父页面代码:

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>无标题文档title>

head>

<script language="javascript">

function tanchu()

{

    window.open("Untitled-5.html");   

}

script>

<body>

    <form id="form1" name="form1" method="post" action="">

        <label> <input type="submit" name="button" id="button" value="提交"

            onclick="tanchu()" />

        label> <label> <input type="text" name="textfield" id="textfield" />

        label>

    form>

</body>

</html>

2.子页面代码:

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>无标题文档title>

head>

<script language="javascript">

function aaa()

{

    window.opener.document.getElementById("textfield").value='123123123';

}

script>

<body>

    <form id="form1" name="form1" method="post" action="">

        <label> <input type="submit" name="button" id="button" value="提交"

            onclick="aaa()" />

        label>

    form>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: