jquery中父窗口和子窗口的问题

第一点:

在窗口中才可以使用window.opener.$(selector).val('value);
在父窗口中要

jquery 获取父窗口元素 parent window
$("#父窗口元素ID",window.parent.document); 对应javascript版本为window.parent.document.getElementByIdx_xx_x("父窗口元素ID");
取父窗口的元素方法:$(selector, window.parent.document);
那么你取父窗口的父窗口的元素就可以用:$(selector, window.parent.parent.document);
类似的,取其它窗口的方法大同小异
$(selector, window.top.document);
$(selector, window.opener.document);
$(selector, window.top.frames[0].document);

原文地址:https://www.cnblogs.com/Minghao_HU/p/2652251.html