Permission denied to access property 'href'

前端 未结 2 1896
隐瞒了意图╮
隐瞒了意图╮ 2021-01-12 03:46

I try to reload parent web page from iframe. Here is my code:

 

        
2条回答
  •  北恋
    北恋 (楼主)
    2021-01-12 04:19

    Your code will be working only when the parent and child are running from the same protocol(http/https), same host and same port. This is known as Same Origin Policy (SOP). You can check the below reference: http://en.wikipedia.org/wiki/Same_origin_policy

提交回复
热议问题