我需要知道,谁在构建我的网站?

时间:2013-06-07 14:58:50

标签: iframe

我只需要知道谁在构建我的网站? 我只是想知道网址。 有没有办法找到它?

  • 我不想打破框架,我只是想知道谁在框架。

感谢。

1 个答案:

答案 0 :(得分:2)

this answer中所述,您可以通过

获取“父”网址
var url = (window.location != window.parent.location) ?
    document.referrer: document.location;

然后您可以(例如)将此网址记录为Google Analytics事件:

_gaq.push(['_trackEvent',
    'framed',
    location.pathname + location.search, // the URL of the iframe (your page)
    url, // the URL of the hosting page
    0,
    true]);
相关问题