gdo*_*ica 3 javascript iframe jquery dom dom-traversal
你可以获得具有属性的a document对象的节点<iframe>contentDocumentHTMLIFrameElement
但我找不到<iframe>退出节点的方法.它和它的文件
之间的关系<iframe>只是一种方式吗?
如果是的话,为什么?
var iframe = document.getElementById('iframe');
var doc = iframe.contentDocument || iframe.contentWindow.document;
var div = doc.getElementsByTagName('div')[0];
console.log('Did we find the iframe? ' + ($(div).closest('iframe').length > 0));?
// Output: "Did we find the iframe? false"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
479 次 |
| 最近记录: |