本文翻译自:Debugging iframes with Chrome developer tools
I'd like to use the Chrome developer console to look at variables and DOM elements in my app, but the app exists inside an iframe
(since it's an OpenSocial app). 我想使用Chrome开发者控制台来查看我的应用中的变量和DOM元素,但该应用程序存在于iframe
(因为它是一个OpenSocial应用程序)。
So the situation is: 所以情况是:
<containing site>
<iframe id='foo' src='different domain'>
... my app ...
</iframe>
</containing site>
Is there any way to access things happening in that iframe
from the developer console? 有没有办法从开发者控制台访问该iframe
发生的事情? If I try to do document.getElementById("foo").something
, it doesn't work, probably