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();  //调用子页面方法

  • 相关阅读:
    2017"百度之星"程序设计大赛
    2018省赛赛第一次训练题解和ac代码
    2018天梯赛第一次训练题解和ac代码
    rsa Round #71 (Div. 2 only)
    AtCoder Grand Contest 021
    Hello 2018
    Educational Codeforces Round 36 (Rated for Div. 2)
    Codeforces Round #462 (Div. 2)
    Codeforces Round #467 (Div. 2)
    [Offer收割]编程练习赛48
  • 原文地址:https://www.cnblogs.com/dengshaojun/p/3625199.html
Copyright © 2011-2022 走看看