Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

html5 mssenger

var loadHandler = function() {
   var mc, portMessageHandler;
   mc = new MessageChannel();
   window.parent.postMessage('documentAHasLoaded','http://foo.example',[mc.port2]);
   
   portMessageHandler = function(portMsgEvent) {
      alert( portMsgEvent.data );
   }
   
   mc.port1.addEventListener('message', portMessageHandler, false);
   mc.port1.start();
}
window.addEventListener('DOMContentLoaded', loadHandler, false);
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #mssenger
ADD COMMENT
Topic
Name
2+2 =