我一直在研究trello api,所以我的问题是我必须在数据库中保存一个令牌。 回复在帖子中:
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/
答案 0 :(得分:0)
据我所知,postmessage是异步的。因此,很难捕获哪个消息被返回到哪个源父/窗口。我想我们可以考虑以下两件事:
frameA.contentWindow.postMessage(msg, frameA.src).
但是,如果我们需要支持许多帧具有相同的href,我的解决方案仍然面临问题。