<!--this is the parent page xdm.html--
<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "UTF-8"> <title>XDM Communication</title> </Head> <Body> <iframeID= "iframeid"src= "http://127.0.0.1:8020/avalon/iframe.html"width= "100%"Height= "600px"></iframe> <Scripttype= "text/javascript">Window.addeventlistener ('Load' , function(){ varIframewindow=document.getElementById ('Iframeid'). contentwindow; Iframewindow.postmessage ("Roll Duzi" , "http://127.0.0.1:8020/avalon/iframe.html"); }); </Script> </Body></HTML>
<!--this is a sub-page, iframe.html--
<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "UTF-8"> <title></title> </Head> <Bodyonload= "aaaa ()"> <Scripttype= "text/javascript"> functionaaaa () {window.addeventlistener ('message' , function(event) {console.log (event); Alert (event.data); },false) } </Script> </Body></HTML>
HTML5 XDm the communication between pages