//父窗口
window.addEventListener('message',(msg)=>{
    console.log(msg)
    document.getElementById('son_call').innerHTML = JSON.stringify(msg.data)
})
//子窗口
<script>
    var pop_btn = this.document.getElementById("son_btn")
    pop_btn.onclick = function(e){
        //window.opener表示当前窗口的父窗口
        //
        alert("发送")
        window.opener.postMessage('I`m Lucifinil_popup')
    }
</script>

 

相关文章:

  • 2022-12-23
  • 2021-09-29
  • 2022-12-23
  • 2021-12-25
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-08
  • 2021-11-19
  • 2022-12-23
  • 2021-08-14
  • 2021-09-29
  • 2021-07-08
  • 2022-12-23
相关资源
相似解决方案