简体   繁体   中英

cross site upload via iframe

I have developed an api for image uploads and am using a jquery plugin which uploads the image via an iframe. But because the upload api's domain is different i cant access the return data in the iframe. Is there a way to access this data in the iframe?

postMessage allows you to send messages across iframes via strings. You could base64 encode your image source if that's what you are asking.

Otherwise, you can't.

If you just need messaging, you can use hash polling technique or postMessage depending on what is supported.

Google these as there is in depth articles on them that would be kind of long to post on there, not that this is an adequate enough solution that I've posted but it should steer you in the right direction in terms of research.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM