简体   繁体   中英

Get JSON text from HTML iframe

I want to submit a form into an iframe and get the result. The result has to be a text that javascript can understand, so I think that JSON is the best idea.

I know how to get the iframe object on javascript, but I have no ideia on how to get the content. The content of my iframe is only JSON, how can I retrieve it with javascript?

You can communicate via JavaScript.

The parent window can be reached using the parent property inside the iframe:

From the iframe do

window.parent.SomeFunctionDefinedInTheParent(JSONObject);

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