iframe 获取父窗口的数据,父窗口获取iframe的数据

来源:互联网 发布:oracle类似md5算法 编辑:程序博客网 时间:2024/05/05 18:53

1.在父窗口中获取指定iframe(testiframe) id 为 testid 的class

 代码如下复制代码$(window.frames["testiframe"].document).find("#testid").attr('class');

2.在IFRAME中获取父窗口中id为testid的class

 代码如下复制代码$(window.parent.document).find("#testid").attr('class');

iframe框架的:

 代码如下复制代码

<iframe src="test.html" id="testiframe" width="700" height="300" frameborder="0" scrolling="auto"></iframe>

0 0