title: Javascript Cross Domain PostMessage not working
body: <p>I have a page that opens a child window (having iframe) and from new page I am calling Parent function to pass some values from Child to parent window. 
  Child Window Code:</p>
  
  <pre><code> window.opener.ParentFunction(sendvalues);
  </code></pre>
  
  <p>Since both are in same domain (example.com)it is working fine for me.
  Now because of some change I need to move my child window to a new domain (new.example.com). Nor i am getting Premission denied error.</p>
  
  <p>In order to fix this I am using PostMessage.</p>
  
  <p>Child window code:</p>
  
  <pre><code>window.parent.postMessage(sendvalues,"*");
  </code></pre>
  
  <p>Parent Code:</p>
  
  <pre><code>var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
  
  var eventer = window[eventMethod];    
  
  var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";
  
  
  eventer(messageEvent, function (e) {
  //for debug    
  alert(e.data);
  
  ParentFunction(e.data);
  
  }, false);
  </code></pre>
  
  <p>This is not working for me I am not getting any value. No error, nothing is happening.
  The code is not getting executed in eventer method.I am not getting any alert.</p>
  
  <p>Any help is greatly appreciated.</p>