How can I get msg send by parent tab ?
KangdaOOLin opened this issue · comments
I check the api doc and I use the broadCastAll
method to broadcast msg, but I can't get msg from child tab. Is there anything I have missed ?
// parent.html
// I can't get the msg send by child
parent.broadCastall(msg);
// child.html
// I also can't get the msg send by parent
child.sendMessageToParent(msg);
Check the example folder.
This file child.html registers a listener function onParentCommunication
var child = new AcrossTabs.Child({
onReady: onReady,
onInitialize: onInitialize,
onParentCommunication: onParentCommunication
})
function onParentCommunication(dataReceived) {
// do stuff with dataReceived from Parent
};
Similarly, Parent can receive messages using:
var parent = new AcrossTabs.Parent({
onHandshakeCallback: onChildCommunication,
onPollingCallback: showList,
onChildDisconnect: onChildDisconnect
});
function onChildCommunication(data) {
// `data` received from child
}
File to check: app.js
Hope, your issue is now resolved.
The issue should be closed now.