iOS iframe內識別不到 WeixinJSBridgeReady 的解決方案

正常情況這樣使用:

document.addEventListener('WeixinJSBridgeReady',function(){
    console.log('WeixinJSBridgeReady')
}, false);

iframe 內需這樣使用:

window.parent.document.addEventListener('WeixinJSBridgeReady',function(){
    console.log('WeixinJSBridgeReady')
}, false);

參考自:https://www.cnblogs.com/miraclesakura/p/7343956.html

或者在根窗口通過 document.getElementById('iframe')... 實現

相關問題:"wechat iOS iframe內視頻無法自動播放"、"微信 ios iframe 自動播放"、"iframe WeixinJSBridgeReady"

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章