iframe頁面調用父頁面的js函數 (轉載)
假若iframe所在的頁面here.html有個JS函數為:wode(),它位于頁面的<script></script>這個節
然后iframe的src,即里面的頁面為:other.html,那么我們在other.html里面就可以如下調用here.html里面的wode這個函數:window.parent.wode();
對于父頁面的控件的引用就如法炮制:window.parent.document.getElementById('xxxx')
來自: http://hi.baidu.com/%D3%DA%EA%BB%CC%ED/blog/item/a8384000e1ddec0f1c9583e6.html
Gavin
posted on 2011-11-24 12:03 GavinMiao 閱讀(829) 評論(0) 編輯 收藏 所屬分類: javascript