News for hackers. Stuff that matters.

Getting content outside an iframe

I remember seeing a similar post to this some time ago but I am not able to find it. Sorry for the repeated posting.

I have an iframe that sources an upload page (for images). Basically, when a user uploads an image, the script returns the location of the image if the upload was successful. Is there a way to obtain this image src outside the iframe (which house the upload page) on the main page?

Thanks

( 2 comments | 2 points | on HN )
Re:Getting content outside an iframe by qhoxie on Tuesday July 29, 2008 @12:27AM (#260060)
Give the iframe an id, select by that id, and then access that variable's contentWindow.document field.
Re:Getting content outside an iframe by airhadoken on Tuesday July 29, 2008 @12:57AM (#260095)
Also don't forget to source the image and the containing page at the same server, or alternately to set document.domain of each side to the common superdomain.