我怎样才能得到这份文件. 我是说,就像当前文件的推荐人一样.
我在我的网站上使用了Document.Referrer:
function statistics() {
if(window.location.href.indexOf("statistics") > -1 && history.length) {
history.back()
} else if(window.location.href.indexOf("games") > -1 && history.length) {
window.location.replace(document.referrer + "/../tournament.html");
} else {
window.location.replace("./tournaments/tournament.html");
}
}
这样做的目的是"记住"用户来自哪里.
现在,可以从该代码所在的站点转到设置站点.因此,所需的等效代码为:
function nftStatistics() {
if(window.location.href.indexOf("statistics") > -1 && history.length) {
history.go(-2)
} else if(window.location.href.indexOf("games") > -1 && history.length) {
window.location.replace(document.referrer.referrer + "/../tournament.html");
} else {
window.location.replace("./tournaments/tournament.html");
}
}
然而,这段代码不起作用,因为Docent.ferrer.referrer不是一个东西. 我希望你能帮助我,想出一个解决方案,因为我一个人解决不了这个问题.
I have already tried个