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.

    要么生,要么死
  • 相关阅读:
    私藏实用免费软件备份
    JavaScript03-基本概念一
    JavaScript02-js使用
    JavaScript第一回-来龙去脉
    初读时间简史的零星杂想
    读《死亡诗社》
    读《生死疲劳》
    js的预解析
    浏览器事件捕获冒泡以及阻止冒泡
    http初探
  • 原文地址:https://www.cnblogs.com/llljpf/p/7141187.html
Copyright © 2011-2022 走看看