cara mengakses fungsi orang tua dari iframe
document.getElementById('targetFrame').contentWindow.targetFunction();
Old Knight
document.getElementById('targetFrame').contentWindow.targetFunction();
window.top.postMessage('hello', '*')
window.onmessage = function(e) {
if (e.data == 'hello') {
alert('It works!');
}
};
myIframe.contentWindow.postMessage('hello', '*');