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

  • 相关阅读:
    词向量的发展
    拉格朗日对偶理解
    EM算法理解
    Xgboost理解
    GBDT理解
    深入理解KS
    PCA主成分分析理解
    SVM理解
    Python调用C++
    Linux opencv安装与编译
  • 原文地址:https://www.cnblogs.com/dengshaojun/p/3625199.html
Copyright © 2011-2022 走看看