Answer the question
In order to leave comments, you need to log in
Onclick location.href - search engines won't ban you?
Hello!
There is a task to hide referral links on the site a little.
Something like this -
<a rel="nofollow" onlick="myFunction()" href="http://example.ru">site.ru</a>
<script>
function myFunction() {
location.href = "http://example.ru?reflink";
return false;
}
</script>
Answer the question
In order to leave comments, you need to log in
You can just leave it like this
<span onclick="myFunction()" class="link">site.ru</span>
<script>
function myFunction() {
location.href = "http://example.ru?reflink";
return false;
}
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question