跳至内容
菜单
此问题已终结
2387 查看

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?


形象
丢弃
相关帖文 回复 查看 活动
0
7月 25
248
1
7月 25
5005
0
7月 25
558
0
6月 25
649
1
6月 25
825