I have two applications A(parent window) and B(child window).
A is hosted in server A1 and B is hosted in server B1.
I need to select and fetch data from child and transfer it to parent on closing .
I am using Window.postMessage() but I am not getting the data in application.
All the servers are connected to network.
I am opening the site A through server name and B url through the ip address.
Below is the code for child window.
function CloseWindowLV(serialobjstr) {
window.addEventListener('message', function (e) {
alert('parent got (from ' + e.origin + '): ' + e.data);
}, false);
window.postMessage(
serialobjstr,
'http://ipaddress/NetViewer');
self.close();
}
Below is the code for parent window
function ee1() {
window.addEventListener('message', receiveMessage, false);
function receiveMessage(event) {
if (event.origin != 'B's address')
return;
alert(event.data);
}
}
I am using javascript.
Any help would be appreciable..