页面中获取iframe中的dom的方法

页面中获取iframe中的dom的方法
$("#inner",top.frames['test'].document).html(); 
兼容方法: top.frames['test'].document获取iframe中的document对象
不兼容: document.frames['test'].document;只有ie识别

页面中获取iframe中的dom的方法
$("#inner",top.frames['test'].document).html();
兼容方法: top.frames['test'].document获取iframe中的document对象
不兼容: document.frames['test'].document;只有ie识别

 

top是获取顶层的window对象

parent是获取父层的window对象

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章