get parent.location.url - iframe - from child to parent

后端 未结 7 2450
时光说笑
时光说笑 2020-11-30 03:12

I got a page that is displayed within an iframe.

I need to get the parent.location.url with js from that page (child page).

Both sites are in different domai

7条回答
  •  再見小時候
    2020-11-30 03:59

    It will only work if the parent page and the iframe are on the same domain. If they are not on the same domain you can try passing the location through the src, like Madison Williams suggested.

    That is probably why you are getting "Permission denied..."

提交回复
热议问题