How can i get the document.referrer.refferer I mean like the referrer of the refferer of the current document.
I used the document.referrer on my site here:
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");
}
}
The purporse is to "remember" where the user has came from.
Now there is a possibility to go to a setting site from that site where this code is. Therefore the equivalent needed code would be:
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");
}
}
However this code does not work, because document.referrer.referrer isnt a thing. I hope you can help me and come up for a solution since i cant solve this issue on my own.
I have already tried
- Searching the Internet
- Searching the Internet for alternatives
- Asking friends