`

window.opener.document

 
阅读更多

 比如通过A窗口打开B窗口,那么B的opener就是A,opener就是打开当前窗口的那个window,   window.opener.document指打开当前窗口的那个window中的document.你可以在当前窗口中用下例改变上级窗口中的响应事件

分享到:
评论

相关推荐

    字符串 window.open() window.opener window.name window对象等的总结

    - `window.document`:提供了对HTML文档的访问,可以用来操作DOM元素。 - `window.alert()`、`window.confirm()`和`window.prompt()`:提供基本的用户交互,如显示警告、确认对话框和输入框。 - `window.setTimeout...

    用window.open,opener实现网页间通信

    var txt = window.opener.document.getElementById("msg"); txt.value = "secondsaysyouwelcome"; }); } function secondcall(msg) { if (msg.indexOf("third") > 0) { tw = window.open("third.html", ...

    window.opener用法和用途实例介绍

    window.opener.document.getElementById('orgNameId').value = name; window.close(); // 关闭子窗口 } } ``` 在上面的 `selectOrg` 函数中,当用户在子窗口中选择一个机构后,它会找到父窗口中的 `orgIdId` 和 ...

    window.showModalDialog以及window.open用法简介

    window.opener.document.getElementById("name").value = "输入的数据"; ``` 这会将新窗口中的数据赋值给父窗口ID为"name"的文本框。 接下来,`window.showModalDialog`是Internet Explorer 4及以上版本引入的方法...

    window.location.href页面跳转的用法(区别于redirect)

    window.opener.document.location.reload(); ``` #### 总结 通过本文的介绍,我们可以看到`window.location.href`不仅能够实现简单的页面跳转,还能灵活地应用于复杂框架结构中的页面跳转及刷新。相比`Response....

    解析jquery获取父窗口的元素

    对应javascript版本为window.parent.document.getElementByIdx_x(“父窗口元素ID”);取父窗口的元素方法:$(selector, window.parent.document);那么你取父窗口的父窗口的元素就可以用:$(selector, window.parent...

    showModalDialog open弹出子窗口操作parent、opener父窗口及跨域处理

    3> IE与FireFox对两个弹出窗口在跨域时的解析也有不同:通过window.dialogArguments操作父窗口时,在IE下不需要指定document.domain而在FireFox下则正好相反需要指定才能生效;采用opener方式操作父窗口时都不需要...

    js弹出窗口返回值

    window.opener.document.getElementById("text1").value = document.getElementById("returnText").value; window.close(); } ``` #### 四、实例分析 考虑以下示例代码: ```html <!-- a.html --> (0)" ...

    javascript经典特效---子窗口对父窗口的操作.rar

    2. 访问或修改父窗口的元素:通过`window.opener.document.getElementById`或`window.opener.document.querySelector`等方法,我们可以找到并操作父窗口中的HTML元素。例如,`window.opener.document.getElementById...

    jsp 刷新父页面

    window.parent.dialogArguments.document.execCommand('Refresh'); 或 Response.Write("<script>window.location.href = window.location.href</script>"); 刷新本页Response.Write("<script>window.location....

    JS窗口大全----很全的哦

    ` 和 `window.opener.location.replace(window.opener.document.referrer);`:这两种方式都可以实现刷新父窗口的效果,区别在于`location.href`会添加新的历史记录,而`location.replace()`则替换当前的历史记录,...

    window.parent与window.openner区别介绍

    比如,b.html中的`getpValue()`函数可以通过`window.opener.document.getElementById("username")`获取到a.html中输入框的值。 两者的主要区别在于: 1. 应用场景:`window.parent` 适用于处理iframe嵌套,而`...

    被打开页面操作父页面上的控件

    例如,可以调用`window.opener.functionName()`来执行父页面定义的函数,或者修改`window.opener.document.getElementById('id').innerHTML`来改变父页面某个元素的内容。 3. **安全限制**: - 由于同源策略的限制...

    js模式化窗口问题![window.dialogArguments]

    在IE中,可以通过`window.dialogArguments`访问父窗口,而在其他浏览器中,如Firefox,可以尝试使用`window.opener.document.getElementById()`来访问并修改父窗口的元素值。不过需要注意,`window.opener.document`...

    让window.close()不提示对话框

    document.body.insertAdjacentHTML("beforeEnd", str); document.all.noTipClose.Click(); } else { window.opener = null; window.open('', '_self', ''); // for IE7 window.close(); } } else { window....

    js中opener与parent的区别详细解析.docx

    添加" onclick="window.opener.document.getElementById('name').innerHTML=document.getElementById('inputValue').value"/> ``` 在这个例子中,页面B通过`window.opener`访问到了页面A,并修改了其中的内容...

    javascript提交父窗口

    window.opener.document.getElementById("b").value = "新的值"; ``` 这里的关键在于使用 `window.opener` 获取到父窗口对象后,再通过 `document` 属性来访问父窗口的 DOM,最后通过 `getElementById()` 方法定位...

    javascript打开静态子窗口

    window.opener.document.getElementById("b").value = "新的值"; window.opener.document.getElementById("f").submit(); ``` #### 5. 关闭子窗口 当子窗口完成了预期的功能后,通常需要将其关闭。这可以通过调用 `...

Global site tag (gtag.js) - Google Analytics