Chitika

Thursday, February 23, 2012

javascript send message to child window from parent window

Parent Window

function ProcessMsgParent(msg) {
.
.
.
}


// open child window
var win = window.open(...);

// send message to child window
win.ProcessMsgChild(msg_to_child);

Child Window

function ProcessMsgChild(msg) {
.
.
.

}

// send message to parent window
window.opener.ProcessMsgParent(msg);

No comments:

Post a Comment