-1
With Javascript, you can create a function to open your links using location.replace()
.
The
replace()
method Replaces the Current Document with a new one.The Difference between this method and
assign()
, is thatreplace()
removes the URL of the Current Document from the Document history, meaning that it is not possible to use the "back" button to navigate back to the original Document.Source: Location replace() Method
In free translation:
The method
replace()
replaces the current document with a new.The difference between this method and
assign()
is thatreplace()
removes the current document URL from the document history, which means that it is not possible to use the "back" button to navigate back to the original document.
Take this example:
function abreLink(e, url) {
e.preventDefault();
window.location.replace(url);
}
<a href="http://google.com" onclick="abreLink(event, 'http://answall.com');">Abrir link sem deixar histórico</a>
that’s exactly what I was looking for. Now taking advantage of this question, is there any way to call this function, using php’s header ? Example: Header("Location: index.php? email=". $email." abreLink");
– Gustavo Macedo
The
header('Location: ...');
follows the same principle. It turns out that it is only recorded in the history page that the user drops at the end.– LipESprY
Thank you so much for everything !
– Gustavo Macedo