zoukankan      html  css  js  c++  java
  • 模态窗口传值与非模态窗口传值

    一、模态窗口传值

      1、父页面传给子页面

        父页面: var arg = {"win":window,"name":"WebForm1.aspx"}

            window.showModalDialog("WebForm2.aspx" , arg);

        子页面: var arg = window.dialogArguments;

            alert(arg.name);  //WebForm1.aspx

            arg.win.SayHello();  //调用父页面方法

      2、子页面回传给父页面

        子页面:  var returnArg = {"win":window,"name":"WebForm2.aspx"}

            window.returnValue = returnArg;

        父页面:  var theValue = showModalDialog("WebForm2.aspx" , arg);

            alert(theValue.name);  //WebForm2.aspx

            theValue.win.SayHello();  //调用子页面方法

    二、非模态窗口传值

      1、父页面传给子页面

        父页面: var arg = {"win":window,"name":"WebForm1.aspx"}

            window.showModelessDialog("WebForm2.aspx" , arg);

        子页面: var arg = window.dialogArguments;

            alert(arg.name);  //WebForm1.aspx

            arg.win.SayHello();  //调用父页面方法

      2、子页面回传给父页面

        子页面:  var returnArg = {"win":window,"name":"WebForm2.aspx"}

            window.returnValue = returnArg;

        父页面:  var theValue = showModelessDialog("WebForm2.aspx" , arg);

            alert(theValue.name);  //WebForm2.aspx

            theValue.win.SayHello();  //调用子页面方法

  • 相关阅读:
    AtCoder Grand Contest 032-B
    AtCoder Grand Contest 032 A
    高橋君とカード / Tak and Cards AtCoder
    Divisibility by 25 CodeForces
    Fire Again CodeForces
    cctype函数 (字符类型判断)
    蓝桥杯--- 历届试题 国王的烦恼 (并查集)
    蓝桥杯---买不到的数目
    算法课(经典贪心)
    完美的数字
  • 原文地址:https://www.cnblogs.com/dengshaojun/p/3625199.html
Copyright © 2011-2022 走看看