zoukankan      html  css  js  c++  java
  • 用window.open函数页面传值

    页面1:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MineXueXi.aspx.cs" Inherits="MineXueXi" %>
    <!doctype html>
    <html charset="utf-8">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title></title>
        <script src="common.js" type="text/javascript"></script>
        <script type="text/javascript">
        <!--
            
    
            function openwin() {
                window.open("MineXueXi01.aspx", "newwindow", "height=100, width=400, toolbar =no, menubar=no, scrollbars=no, resizable=no, location=no, status=no") //写成一行
            } 
          -->
        </script>
    </head>
    <body>
        <input type="button" value=" open winow " onclick="openwin();" />
        <div id="div1">
        </div>
    </body>
    </html>

    页面2:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MineXueXi01.aspx.cs" Inherits="MineXueXi01" %>
    
    <!doctype html>
    <html charset="utf-8">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title></title>
        <script src="common.js" type="text/javascript"></script>
        <script type="text/javascript">
        <!--
            window.onload = function () {
                window.opener.document.getElementById("div1").innerHTML = document.getElementById("text1").value;
            }
         -->
        </script>
    </head>
    <body>
        <input type="text" id="text1" name="text1" value="0624" />
    </body>
    </html>
    /**      
    *打开模态窗口      
    *@url 地址      
    *@width 宽度      
    *@height 高度      
    */
    function showDialog(url, width, height) {
        var x = parseInt(screen.width / 2.0) - (width / 2.0); var y = parseInt(screen.height / 2.0) - (height / 2.0);
        if (window.ActiveXObject) {
            retval = window.showModalDialog(url, window, "dialogWidth:" + width + "px; dialogHeight:" + height + "px; dialogLeft:" + x + "px; dialogTop:" + y + "px; status:no; directories:yes;scrollbars:no;Resizable=no; ");
        }
        else {
            var win = window.open(url, "mcePopup", "top=" + y + ",left=" + x + ",scrollbars=" + scrollbars + ",dialog=yes,modal=yes,width=" + width + ",height=" + height + ",resizable=no");
            eval('try { win.resizeTo(width, height); } catch(e) { }');
            win.focus();
        }
    }      

    如果这篇文章对您有帮助,您可以打赏我

    技术交流QQ群:15129679

  • 相关阅读:
    Delphi数据库处理
    delphi 递归的方法
    C#中StringBuilder用法以及和String的区别
    算法导论12.2节习题解答
    算法导论9.11习题解答(二叉树)
    算法导论10.15习题解答(deque实现源码)
    算法导论9.39习题解答(寻找中位数)
    算法导论84习题解答
    算法导论10.17习题解答(用两个队列实现一个栈)
    算法导论10.27习题解答(单链表逆转)
  • 原文地址:https://www.cnblogs.com/yeminglong/p/3126565.html
Copyright © 2011-2022 走看看