I'm trying to compare the next page using history.go (), ie comparing the next page with a given url to get a positive result.
SEE:
function a() {
if (history.go(2) == "http://www.google.com.br") {
alert("ok");
}
}
</script>
<button onclick="a()">verificar</button>
But nothing happens!
Another interesting thing would be if you could display the following url, with:
alert(history.go(2))
or
alert(history.forward())
But the result you get is undefined.
Or check if a URL is in history:
if (window.history.go("http://www.google.com.br")== true){
alert("ok");
}
Or even check if there is a next page in history, such as:
if (history.forward() == true){
alert("ok")
}
If anyone can help me, thank you in advance.