Javascript examples for DOM:Event
Use event source to call postMessage
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> </head> <body> <iframe src="http://your server html"></iframe> <script> var token = "abc"; window.addEventListener("message", receiveMessage, false); function receiveMessage(event) { if (event.data === "accquireToken") event.source.postMessage(token,"*"); }//from ww w. j a va 2 s. c o m </script> </body> </html>