【问题标题】:How to check if your site is loaded in iframe and fetch parent URL? [duplicate]如何检查您的网站是否已在 iframe 中加载并获取父 URL? [复制]
【发布时间】:2016-12-07 23:56:12
【问题描述】:

我目前正在开发一个将通过 iframe 加载的应用程序,我有兴趣从父站点获取 URL。

【问题讨论】:

    标签: javascript php jquery


    【解决方案1】:

    top != self -> 如果被陷害则为真

    top.location.href -> 获取首页网址

    window.parent.location.href -> 获取父母的网址

    【讨论】:

      猜你喜欢
      • 2014-06-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多