鍍金池/ 問答/HTML/ iframe 在組件中怎么用里面的方法呢?現(xiàn)在元素我都沒有獲取到

iframe 在組件中怎么用里面的方法呢?現(xiàn)在元素我都沒有獲取到

iframe 在組件中怎么用里面的方法呢?現(xiàn)在元素我都沒有獲取到,這是為什么呢?

clipboard.png

clipboard.png

   var frame = document.getElementById("ueditor_0");
    var frameDocument = frame.contentWindow.document;
    console.log(frameDocument);

頁面

clipboard.png

body里面沒有東西,怎么解決呢?

回答
編輯回答
糖果果

可以用postMessage進(jìn)行數(shù)據(jù)傳遞,可以傳遞字段讓iframe內(nèi)外保持信息交互

2018年2月15日 21:42