zoukankan      html  css  js  c++  java
  • javascript弹出子窗口并返回值

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    </head>
    <script type="text/javascript">
    function returnWin(){
    window.returnValue
    =document.Form2.TextBox1.value;
    window.close();
    }
    </script>


    <body>
    <form name="Form2" id="Form2">

    <input name="TextBox1" id="TextBox1" value="123" type="text" />
    <input name="button" value="返回" type="button" onclick="returnWin();" />
    </form>
    </body>
    </html>
    1.html
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    </head>
    <script> 
    function OpenWin(){
        
    var str=window.showModalDialog('2.html',document.Form1.TextBox1.value,'help:no');
        
    if(str!=null)  {
            document.Form1.TextBox1.value
    =str;
        }
    }
    </script>

    <body>
    <form name="Form1">
    <input name="TextBox1" id="TextBox1" value="1" />
    <input type="button" name="Button1" value="打开窗口" onclick="OpenWin();" id="Button1" style="96px;" />
    </form>
    </html>

    2.html

  • 相关阅读:
    .NE 学习概要
    (转)工作之路---记录LZ如何在两年半的时间内升为PM
    XP下Winform背景透明问题
    CSE(Corrupted State Exceptions) 严重异常处理办法
    (转)C#模拟键盘鼠标事件
    (转).net项目技术选型总结
    (转)MSMQ续
    (转)MSMQ(消息队列)
    (转)TCP三次握手
    Socket编程初探
  • 原文地址:https://www.cnblogs.com/didiao/p/1422103.html
Copyright © 2011-2022 走看看