javascript get iframe url's current page on subdomain

后端 未结 1 1825
难免孤独
难免孤独 2021-01-29 00:49

I need to get the page url of what the iframe on my pages are on, as we use the iframe to deal with ordering products. However, for the life of me I can\'t seem to get it to dis

1条回答
  •  孤街浪徒
    2021-01-29 01:21

    add document.domain = 'your.domain' in both the pages.

    like this. don't forget both parent.top

    document.domain = 'corp.local';

    only parent like

    document.domain = 'corp';

    won't work.

    0 讨论(0)
提交回复
热议问题