İçereği Atla
Menü
This question has been flagged
2005 Görünümler

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
Vazgeç
Related Posts Cevaplar Görünümler Aktivite
1
May 25
740
0
Mar 25
393
1
Ara 24
2873
2
Kas 24
1148
1
Eki 24
1744