Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2398 Visualizzazioni

Hi all,

I have this code to initialize an iframe:


    < t t-if="lang=='en_US'">
< script id="my-corner">script for iframe
< /script >
< /t >



    
I have to call a post message on contentWindow:


document.getElementById("my-corner").contentWindow.postMessage("consentTrue","destinationurl.com");


But I'm getting this error:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'postMessage')


Can anyone help to understand the error (I think it is due the iframe is not still full loaded)


Where I can put the code to call post message with no error?


Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
lug 25
271
1
lug 25
5044
0
lug 25
608
0
giu 25
690
1
giu 25
860