0

I have a like button that is loaded from ajax on to my page. When the user clicks it, a popup appears with a textbox that the user can fill and a description of my website. I want to access the dom of that popup, which is in an iframe.
This is so I can add text to the textbox.

All of the following is done in Firebug's Console.
I access the iframe with this:

var x = document.getElementsByTagName("iframe")[3] // the '3' selects this specific iframe

Then, I try this...

x.documentWindow

And I get

undefined

Now this probably has something to do with it, but Firebug's DOM Window does not show inside the iframe. It just shows this:

<iframe id="f3fb49f36c" name="f1b13ffab" scrolling="no" style="border: none; overflow: hidden; height: 225px; width: 401px; " class="fb_ltr" src="http://www.facebook.com/plugins/comment_widget_shell.php?locale=en_US&master_frame_name=f39fb5fa34&offsetX=0&sdk=joey"/>

BUT, in in the Element tab under Chrome's Developer Tools, I can see everything inside it.

Any help you can offer is appreciated.

4

1 に答える 1

0

https://en.wikipedia.org/wiki/Same-origin_policyをご覧ください。

不可能です。

于 2012-07-12T07:16:55.363 に答える