Closed tianxu0836 closed 11 years ago
Aha! I got it. This way works:
Child:
var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : undefined); $.postMessage("ZoomIn", '*', target);
Parent: $.receiveMessage(function (e) { alert(e.data); });
Fancy closing this, @tianxu0836 ?
Parent: iframe src="http://localhost/WebFlowUI/ZoomInOut2.aspx"
js code- $(function () { $.receiveMessage(function (e) { alert(e.data); }, 'http://localhost/WebFlowUI/'); });
Child: var parent_url = "file:///C:/HomeWeb/test.html"; $.postMessage("ZoomIn", parent_url, parent);
I just found this plugin, I'm not able to make it work with the example code. In my test html, I have a iframe. In iframe I have a zoom in button. I need the parent receive msg from that button.