彩世界平台-彩世界时时app-彩世界开奖app苹果下载

热门关键词: 彩世界平台,彩世界时时app,彩世界开奖app苹果下载

您的位置:彩世界平台 > 新闻动态 > js弹窗返回值详解(window.open方式)

js弹窗返回值详解(window.open方式)

发布时间:2019-09-03 08:17编辑:新闻动态浏览(183)

    ...

    test.php

    复制代码 代码如下:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ";
    <html xmlns=";
    <head>
    <meta http-equiv="Content-Language" content="utf-8" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="author" content="脚本之家(MyZ)" />
    <meta name="Copyright" content="脚本之家(MyZ)" />
    <meta name="description" content="" />
    <meta name="keywords"content="" />
    <link rel="icon" href="" type="image/x-icon" />
    <link rel="shortcut icon" href="" type="image/x-icon" />
    <link href="" rel="stylesheet" type="text/css" />
    <title></title>
    <script type="text/javascript">
    <!--
    function winOpen()
    {
           window.open ("test2.php", "", "height=400, width=400");
    }
    -->
    </script>
    </head>
    <body>
    <textarea id="text1" name="text1"></textarea>
    <input type="button" value="submit" name="submit" onclick="javascript:winOpen();" />
    </body>
    </html>
    </body>
    </html>

    test2.php

    复制代码 代码如下:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ";
    <html xmlns=";
    <head>
    <meta http-equiv="Content-Language" content="utf-8" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="author" content="脚本之家(MyZ)" />
    <meta name="Copyright" content="脚本之家(MyZ)" />
    <meta name="description" content="" />
    <meta name="keywords"content="" />
    <link rel="icon" href="" type="image/x-icon" />
    <link rel="shortcut icon" href="" type="image/x-icon" />
    <link href="" rel="stylesheet" type="text/css" />
    <title></title>
    <script type="text/javascript">
    <!--
    function winBack()
    {
           if(window.opener) {
                  fWindowText1 = window.opener.document.getElementById("text1");
                  fWindowText1.value = fWindowText1.value + "mayongzhan";
                  window.close();
           }
    }
    -->
    </script>
    </head>
    <body>
    <input type="button" name="back" value="back" onclick="javascript:winBack();" />
    </body>
    </html>

    window.open详解

    window.open("sUrl","sName","sFeature","bReplace");

    sUrl:可选项。字符串(String)。指定要被加载的HTML文档的URL地址。假如无指定值,则about:blank的新窗口会被显示。

    sName:可选项。字符串(String)。指定打开的窗口的名字。这个名字可以用于form或a对象的TARGET属性。此名字也可以使用下列通用名称:_media:IE6.0在浏览器左边的媒体面板内打开sUrl。

    本文由彩世界平台发布于新闻动态,转载请注明出处:js弹窗返回值详解(window.open方式)

    关键词:

上一篇:jQuery获得内容和属性示例代码

下一篇:没有了