Is there a way to get the parent URL from an Iframe's content?

前端 未结 3 929
一生所求
一生所求 2020-12-03 18:08

I\'m running an c# .net app in an iframe of an asp page on an older site. Accessing the Asp page\'s session information is somewhat difficult, so I\'d like to make my .net a

3条回答
  •  天命终不由人
    2020-12-03 18:49

    top.location.href
    

    But that will only work if both pages (the iframe and the main page) are being served from the same domain.

提交回复
热议问题