2016-08-13 113 views
2

如何获取iFrame中的所有元素?我使用一些JavaScript代码在这里,但我不知道接下来我做什么,以及如何获取里面的所有元素中的iframe:获取iFrame中的所有元素

<iframe id="uploads" src="https://jsfiddle.net/mekwall/up4nu/"></iframe> 

var iframe = document.getElementById('uploads'); 
var innerDoc = iframe.contentDocument; 

我使用contentDocument这是只给出<html><body></body></html>

+0

您无法使用Javascript读取其他域的内容。 –

回答