i have been working on trello api so my issue is that i have to save a token in database. response is in post message :
window.opener.postMessage("token generated here ", "http://www.servername.com")
1. how to fetch token from post message.
2.i have tried code from this link :http://stackoverflow.com/questions/3332532/how-can-i-do-cross-domain-postmessage. but is not working.
3. https://developer.mozilla.org/en-US/docs/Web/API/window.postMessage this link i also go through .
snapshots step by step here is
step 1: authentication with oath :http://postimg.org/image/5cwazfvfv/
step 2: when i press allow button to get token i recieve this window and here
url: http://postimg.org/image/f3y34m2dz/
As I know, postmessage is asynchornious. Consequently, it's hard to capture which message is returned to which source parent/window. I think we can consider 2 things as below:
frameA.contentWindow.postMessage(msg, frameA.src).
However, my solution still face problem if we need to support many frame has the same href.
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.