javascript postMessage not working

前端 未结 4 1377
南笙
南笙 2021-02-03 23:19

I don\'t know what to do. I tried several sample codes from different sources, I tried them in different browsers (from Chrome 9 to FF 4), and still nothing seems to be working

4条回答
  •  清酒与你
    2021-02-04 00:19

    If you are not dealing with different origins, entering location.origin as the targetOrigin will work.

    top.postMessage('hello', location.origin);
    

提交回复
热议问题