6 ms·
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
- qhoxie 18y agoGive the iframe an id, select by that id, and then access that variable's contentWindow.document field.
- airhadoken 18y agoAlso 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.