Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to access parent function from iframe

document.getElementById('targetFrame').contentWindow.targetFunction();
Comment

send response from iframe to parent

window.top.postMessage('hello', '*')
Comment

send response from iframe to parent

window.onmessage = function(e) {
    if (e.data == 'hello') {
        alert('It works!');
    }
};
Comment

send response from iframe to parent

myIframe.contentWindow.postMessage('hello', '*');
Comment

PREVIOUS NEXT
Code Example
Javascript :: setattribute 
Javascript :: carousel in material ui react 
Javascript :: elif in js 
Javascript :: compare date value in javascript 
Javascript :: electron 
Javascript :: sort array of objects javascript by properties value 
Javascript :: react select 
Javascript :: inline styling javascript 
Javascript :: promise 
Javascript :: promise js 
Javascript :: add spinner angular 13 loading 
Javascript :: upload file from url javascript 
Javascript :: window.addeventlistener multiple events 
Javascript :: nextjs starter template with auth 
Javascript :: es6 foreach dom element 
Javascript :: for loop js Alternatives 
Javascript :: javascript detect when youtube video ends 
Javascript :: document.getelementsbyname 
Javascript :: ajax returning html instead of json 
Javascript :: react router dom v6 navigate replace 
Javascript :: synchronized function javascript 
Javascript :: strong password javascript 
Javascript :: getting started with react 
Javascript :: display component in popup angular 8 
Javascript :: every element in list after first javascript 
Javascript :: react return value from component 
Javascript :: udpdate records using axios http put method 
Javascript :: use promise in angular 8 
Javascript :: require vs import 
Javascript :: adding more than one class react 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =