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.

    要么生,要么死
  • 相关阅读:
    关于ping github.com超时的解决办法
    git使用过程中的若干问题笔记
    PAT甲级1017题解——模拟排序
    第七章4
    第七章3
    第七章2
    第七章1
    第六章4
    第六章3
    第六章2
  • 原文地址:https://www.cnblogs.com/llljpf/p/7141187.html
Copyright © 2011-2022 走看看