Re:How Google +1 Widgets "Break Out" of their IFRAMEs
by alanh on Tuesday September 06, 2011 @01:46AM
(#2964318)
They are in <iframe>s. Just not one <iframe>, and the code is not originally included via <iframe>.
But yeah, since it creates the illusion of breaking out, the submission title has the phrase in quotes.
Re:How Google +1 Widgets "Break Out" of their IFRAMEs
by Stratoscope on Tuesday September 06, 2011 @02:01AM
(#2964357)
That's right, the bulk of the gadget may run in one or more iframes. I just meant that they do load a script element into the host page.
Once you do that you can do anything to the page, and you can also use one of several methods to have this script communicate with scripts inside the iframes that it creates.
As the first SO response points out, the widget is JavaScript code that runs in the host page, so it can easily create and manipulate any kind of DOM element anywhere in that page. Of course there may be iframes among those elements, but the JS code isn't limited to that.