Client-side link cloaking script (newbies)

b4br 514h

Newbie
Joined
Dec 19, 2011
Messages
34
Reaction score
10
Here is a little test script I just wrote and should work to cloak links client-side, i wanted to share with you guys, specially newbies :)

This shows a normal link (internal link) to the user when hovering, but when he clicks it takes them to other link (internal or external, aff. link for example)

Note: I haven't tested it very much, but should work in all major browsers ;)
Note also: you should also cloak server-side since google Will see this and f*** you

Code:
<html>
<head><title>Cloak test</title>

<script type="text/javascript">

var CLOAKED_LINK = "your-evil-script.html"; //change this value to your link

function cloakIt(event) {
   event.returnValue = false;
   if(event.preventDefault) event.preventDefault();
   window.location.href = CLOAKED_LINK;
   return false;
}
</script>

</head>
<body>

<a href="./friendly.html" onclick="cloakIt(event)" >Soccer</a>

</body>
</html>
 
Back
Top