zoukankan      html  css  js  c++  java
  • HTML 父窗口打开子窗口,并从子窗口返回值

    父窗口:windowdemo.html

    <html>

    <head>

    <title> 接收子窗口返回的内容 </title>

    <script language="JavaScript">

    function shownewpage(thisurl)

    { window.open('content.html','content','width=480,height=330,top=150,left=280, toolbar=no, menubar=no, scrollbars=auto, resizable=no, location=no, status=no'); }

    </script>

    </head>

    <body> <form action="" method="post" name="parentform"> <input type="button" value="选择信息" onclick="shownewpage('content.html');"> <br> 选择的结果:<input type="text" name="result"/>

    </form>

    </body>

    </html>

    子窗口: cntent.html

    <html>

    <head>

    <title>返回内容 </title>

    <script language="JavaScript">

    function returnValue()

    {  var city=document.myform.city.value var doc=window.opener.document; doc.parentform.result.value=city; window.close(); }

    </script>

    </head>

    <body>

    <form name="myform" >

    选择:

    <select name="city">

    <option value="北京">北京</option>

    <option value="天津">天津</option> </select>

    <input type="button" value="返回" onclick="returnValue()">

    </form> </body> </html>

    ya tudou
  • 相关阅读:
    POJ2503 Babelfish
    POJ3687 Labeling Balls(拓扑)
    POJ2251 Dungeon Master(bfs)
    POJ1321 棋盘问题(dfs)
    POJ3009 Curling 2.0(DFS)
    POJ2248 A Knight's Journey(DFS)
    POJ3080 Blue Jeans
    POJ1260 Pearls(dp,矩阵链乘法)
    POJ3349 Snowflake Snow Snowflakes(哈希)
    POJ2479 Maximum sum(dp)
  • 原文地址:https://www.cnblogs.com/sdu-Jumper/p/4757754.html
Copyright © 2011-2022 走看看