获取父窗口的xxx节点的方法

window.parent.document.getElementById("xxx");获取父窗口的xxx节点
$("#myEle", window.parent.document).html(html);

即指明了是在 window.parent.document 中查找 id=myEle 的元素。

随着前面的问题的解决(其实是对 jQuery 的了解不够),现在两种方案都可以实现我需要的效果了。

另外还有一种实现方式,代码如下:

1.parent.$("#myEle").html(html);
这种方法要求父文档也要调用 jQuery 。

猜你喜欢

转载自www.cnblogs.com/xiyuekamisama/p/9034961.html
今日推荐