获取包含片段标识符的引荐网址 [英] Get Referrer URL including fragment identifier
问题描述
我在另一个网站中嵌入了一个名为 iframe
的网站,它们来自不同的域。
document.referrer
我可以得到所有的东西,直到散列,有没有办法做到这一点? 给定标准的 RFC2616 (章节14.36)片段标识符不包含在引用者标题中。 JavaScript W3C定义规定了一个参考到 RFC2396 中指定的完整URI,其中包含片段标识符。
尽管我没有看到任何技术原因,但浏览器实现无法在JavaScript中提供完整的引用,我认为实现非常接近HTTP规范,甚至可能依赖于浏览器。据我所知,所有浏览器都使用JavaScript来实现引用链接,而不使用片段标识符。
I have a website embedded as iframe
in another website, they are from different domains.
I need to get the url in the address bar including the part after hash sign (#) from the iframe. With document.referrer
I can get everything until the hash, is there a way to do this?
Given the standard RFC2616 (chapter 14.36) the fragment identifier is not included in the referrer header. The JavaScript W3C definition states a reference to a full URI as specified in RFC2396 which would include the fragment identifier.
While I see no technical reason a browser implementation could not give a full referrer in JavaScript I suppose the implementation is very close to the HTTP specs and maybe even browser dependent. To my knowledge all browsers implement the referrer in JavaScript without fragment identifier.
这篇关于获取包含片段标识符的引荐网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!