【问题标题】:How can I get the contentWindow.location of the iframe, where the iframe src contains different domain name?如何获取 iframe 的 contentWindow.location,其中 iframe src 包含不同的域名?
【发布时间】:2010-06-15 11:00:43
【问题描述】:

如何获取 iframe src 包含不同域名的 iframe 的 contentWindow.location? 我对此进行了谷歌搜索,但我发现了类似 proxt 的东西,那么如何获取 iframe src 不在同一个域中的 iframe 内窗口的位置?

【问题讨论】:

  • 我不明白这个问题。拳头你说,你尝试使用 iframe 获取窗口的位置,然后你说你尝试在 iframe 中获取窗口的位置。你能得到示例 html 代码吗?

标签: javascript iframe cross-domain location


【解决方案1】:

浏览器端 XSS 规则阻止访问并在 contentWindow.location 中显示外部 URL。你不能这样做。

【讨论】:

    猜你喜欢
    • 2017-10-20
    • 2015-06-23
    • 1970-01-01
    • 2016-06-30
    • 2014-06-10
    • 2012-04-21
    • 1970-01-01
    • 1970-01-01
    • 2012-10-13
    相关资源
    最近更新 更多