【发布时间】:2018-07-18 13:58:27
【问题描述】:
此代码适用于 Google Chrome,但不适用于 IE 和 Firefox。 网站“somesite.org”向我发送 302(重定向)。 当它来自特定站点 (somesite.org) 时,我想重定向到我站点中的特定文件。
代码:
var url = document.referrer;
if (url.includes("somesite.org")) {
window.location.href = "http://forthisfile.com/this.html"
}
【问题讨论】:
-
查看:IE没有设置document.referrer StackOverFlow:Equivalent document.referrer others
标签: javascript