没找到很好的方法
只好用DOM方法与jquery方法结合的方式实现了

1.在父窗口中操作 选中IFRAME中的所有单选钮
$(window.frames["iframe1"].document).find("input[@type='radio']").attr("checked","true");

2.在IFRAME中操作 选中父窗口中的所有单选钮
$(window.parent.document).find("input[@type='radio']").attr("checked","true");

iframe框架的:<iframe src="test.html" id="iframe1" width="700" height="300" frameborder="0" scrolling="auto"></iframe>

IE7中测试通过 回去你自己试试吧
刚才google到的,补充一下

I beat my head against this wall for quite some time.

Try this:
$("#myid", top.document);
the top.document tells the selector to target the myid element which
exists in the topmost document (your parent page). In order for this
to work, jquery must be loaded in the file which is viewed through the
iframe.

我的代码
$('#parentElem', top.document).append('<div class="imgbox" id="imgbox"><img class="img" src="pp.png" id="img"></div>');

upc不是说了么
1.在父窗口中操作 选中IFRAME中的所有单选钮
$(window.frames["iframe1"].document).find("input[@type='radio']").attr("checked","true");

那选择id自然就是依然使用find方法
$(window.frames["iframe1"].document).find("#id")

实际楼上上的方法本质上在Jq内部也是调用了find方法

 
父窗体调用IFrame中的方法(right)为ifram的id
document.frames["right"].expand();
父窗体:parent;

子窗体:opener;(window.opener.reload();)

上面的都是网上摘的,下面补充很重要的一点:

你可能已经注意到了,上面提及的都是自上而下的selector方法,也就是从上级window查找下级window(包括iframe创建的window),如果我们希望从下级window,比如希望通过iframe中的window找到iframe的parentNode,可以这样:

var parentFrame=null;
if(window!=window.top){parentFrame=window.frameElement.name};

往下就可以直接$(.....

当然,一个topwindow中仅仅包含一个iframe时我们没有必要这样,但当若干iframe存在时,这个方法还是很有用的。

最新文章

  1. 遍历dynamic的方式
  2. sendEmail
  3. 家教O2O维护“老师”的逼格,算不尊重市场吗
  4. SQL盲注之正则攻击
  5. 8.4c#递归
  6. POJ 2983 Is the Information Reliable?(差分约束系统)
  7. Json.Net从4.0升级到7.0带来的问题
  8. angular 时间戳转换
  9. nagios与zabbix对比
  10. Intellij IDEA超好用的快捷键
  11. 4.5 explain 之 ref
  12. 用xstart远程连接linux图形用户界面
  13. PyQt5--QComboBox
  14. 绝对定位后,position:absolute;不能使用margin: 0 auto;实现居中;
  15. (八十七)AutoLayout的简单介绍与实例
  16. Go之单元测试
  17. hadoop IPC 源代码分析
  18. [AHOI2005]矿藏编码
  19. PO_PO接受入库时的接受方式详解(概念)
  20. zookeeper未授权访问漏洞

热门文章

  1. 任何一个大于1的自然数n,总可以拆分成若干个小于n的自然数之和。
  2. hdu 4336 概率dp
  3. 【BZOJ-2888】资源运输 LCT + 启发式合并
  4. [Go] 正则表达式 示例
  5. Web登陆实例-—同步username
  6. Reactor与Proactor比较
  7. select,poll,epoll之间的区别
  8. Hadoop: the definitive guide 第三版 拾遗 第四章
  9. Delphi模拟最小化恢复关闭按纽
  10. windows操作系统查看占用端口的进程