Home > front end >  Cross-domain calls page, how to get the data?
Cross-domain calls page, how to get the data?

Time:11-11

I wrote a page address selection, mainly for linkage drop-down box to select the address, and write page, provide for the use of others, this call is cross-domain,
My current idea is: people use the iframe page I embedded in their system, the other side of using postMessage sends a message to me said want access to the selected address, I'll send by postMessage will address each other, each other to monitor events to get the data again,
A gut feeling, this method is the trouble, do not know who to have better ideas, please teach

CodePudding user response:

Call your page, by the way, could you let the parent page linked with domain address [such as: get HTML] to you, then your page also has a iframe

In your page load is complete: iframe.src=https://bbs.csdn.net/topics/get.html? Address=; Is a null value, let the other side clear address
After the completion of the operation: iframe.src=https://bbs.csdn.net/topics/get.html? Address=good rules, according to your attached on your selected address,

Then get. Just need to get the address in HTML, and its clear when a null value, not empty value write cookies just like

The actual page page and then call you, as long as in any place, want to use to read the cookie, do the corresponding business logic can

This???????
  • Related