我在我的html页面中有一个iframe,我想从此iframe中打开的页面访问一些内容。使用JavaScript访问跨域iframe元素
<table border="1" width="100%" height="100%">
<tr>
<td id = "freebase_td">
<iframe id = "freebase_frame" src="http://www.freebase.com/view/en/angelina_jolie" width="100%" height="400px"></iframe>
</td>
</tr>
</table>
在这个网页的源代码,
<h1 id="page-title">
Angelina Jolie
</h1>
我想ID为“网页标题”访问h1标签内容使用JavaScript。有可能吗?
可能的重复http://stackoverflow.com/questions/364952/jquery-javascript-accessing-contents-of-an-iframe – spicavigo
页面是在两个单独的域?那么,上面的页面和[http://www.freebase.com/view/en/angelina_jolie](http://www.freebase.com/view/en/angelina_jolie)? –
你不能。谷歌“相同的来源政策”,看看为什么。 –