I've uploaded an HTML containing the following section:
<script>
window.onload = function(){
window.addEventListener('message', receiver, false);
}
function receiver(event) {
if (event.origin == 'http://documentA.com') {
if (event.data == 'Hello B') {
//event.source.postMessage('Hello A, how are you?', event.origin);
alert("Recognized.");
} else {
//alert(event.data);
alert("Unrecognized!");
}
}
}
</script>
The document is accessible and I can view it in the browser. Then, I open a console window using FireBug and type in the following call (as described at Wikipedia).
window.postMessage("12345", "http://server:port/Index4.htm");
As a result I get undefined and frankly I have no clue if it's a good thing or a bad thing. Probably bad, especially since I don't get to see any alerts. What to do?