zoukankan      html  css  js  c++  java
  • window.opener

    1.打开父窗口:

        var url = "http://" + window.location.host + "/ContratorSelfAssess/AssessPaper?data=" + data;
        window.open(encodeURI(url), "100%,height:100%,toolbar:true");


    2.window.opener 实际上就是通过window.open打开的窗体的父窗体。即 window.opener是指调用window.open方法的窗口。 比如在父窗体parentForm里面 通过 window.open("subForm.html"),那么在subform.html中 window.opener 就代表parentForm,可以通过这种方式设置父窗体的值或者调用js方法。

    作用:

       (1)window.opener.test(); ---调用父窗体中的test()方法

       (2)如果window.opener存在,设置parentForm中stockBox的值。

           if (window.opener && !window.opener.closed) {

           window.opener.document.parentForm.stockBox.value = symbol;}

       (3)在子页面中想要刷新父页面。window.opener就相当于主窗口的window.

            主窗口刷新:window.opener.location.reload();或者window.opener.yourformname.submit()

    
    
    
    
     

     

    2.

    要么生,要么死
  • 相关阅读:
    MFC常用控件使用方法
    用CImage类来显示PNG、JPG等图片
    javascript
    gSoap学习笔记
    Linux增加Swap分区
    nagios 监控shell脚本
    新机器连接老机器遇到的ERROR
    linux下PS1命令提示符设置
    python基础篇之进阶
    mysql不能使用localhost登录
  • 原文地址:https://www.cnblogs.com/llljpf/p/7141187.html
Copyright © 2011-2022 走看看