跳至內容
選單
此問題已被標幟
1952 瀏覽次數

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
3月 25
307
0
2月 25
541
1
12月 24
2571
2
11月 24
947
1
10月 24
1586