Can I do synchronous cross-domain communicating with window.postMessage?
问题 I'm thinking of using window.postMessage directly for cross-domain communication. If I do: postMessage() from the parent frame Load an iframe window.addEventListener("message", callback, false); from the child iframe When will the messages I posted before loading the iframe be executed? Are they guaranteed to be executed at all? Are there timing guarantees? I would like to pass a parameter from the top frame that influences the initialization of the child frame. 回答1: The postMessage()