1
I am trying to compare the next page using history.go(), that is by comparing the next page with a certain url to get a positive result.
SEE:
function a() {
if (history.go(2) == "http://www.google.com") {
alert("ok");
}
}
</script>
<button onclick="a()">verificar</button>
But nothing happens at all!
Another interesting thing would be if you could display the following url, with:
alert(history.go(2))
or
alert(history.forward())
But the result is undefined.
Or else check if a URL is in history:
if (window.history.go("http://www.google.com")== true){
alert("ok");
}
Or even check if there is a following page in history, such as:
if (history.forward() == true){
alert("ok")
}
If anyone can help me, I’d appreciate it.
I I suppose that this is not possible because somehow compromises the privacy of the user.
– Renato Gama