頁面中獲取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對象

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