GetIFrameDocument.js
出自ProgWiki
用途
- 取得IFrame裡的Document物件(IE 與 FireFox通用函數)。
出處
程式碼
function GetIFrameDocument(id) { var ret = null; // if contentDocument exists, W3C compliant (Mozilla) if (typeof(document.getElementById(id).contentDocument) != "undefined") { ret = document.getElementById(id).contentDocument; } else { // IE ret = document.frames[id].document; } return ret; }