弹窗
基本语法: window.open(pageURL,name,parameters)
// 父页面打开弹窗
window.open("Untitled-1.html","","width=400,height=200");
父页面引用
opener 属性是一个可读可写的属性,可返回对创建该窗口的 Window 对象的引用。
// 子页面, 对 父页面 id=parentDomID input(或其他) 赋值
window.opener.document.getElementByIdx("parentDomID").value="值内容";
// 刷新父窗口
window.opener.location.reload();
参考文档
- HTML DOM opener 属性
- window.opener 的用法
- When to use window.opener / window.parent / window.top
window.opener / window.parent / window.top
- window.opener refers to the window that called window.open( … ) to open the window from which it’s called
- window.parent refers to the parent of a window in a or
- window.top refers to the top-most window from a window nested in one or more layers of