gpt4 book ai didi

iframe - iframe 父级的 document.referrer

转载 作者:行者123 更新时间:2023-12-02 00:51:36 24 4
gpt4 key购买 nike

我有一个页面 - page1.html,其中包含带有 url(src) iframepage.html 的 iframe。当我单击 iframepage 中的链接时,我会转到其他网站 - page2.html。如果我在 page2.html 上调用 document.referrer,我就会得到 iframepage url。根据 document.reffer 定义,这是正确的 - 这是打开当前文档的文档,但是:

有什么方法可以将 page1.html 作为 page2.html 上的 document.referrer 获取吗?

从 page2.html 我必须知道 page2.html 从哪个浏览器 URL 打开。

谢谢

最佳答案

在page2.html中你可以检查window.parent.location.href在 javascript 中返回包含 <iframe> 的父级 URL .

关于iframe - iframe 父级的 document.referrer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6120181/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com