how to hide links in javascript

dziadekx

Newbie
Joined
Feb 20, 2010
Messages
15
Reaction score
1
Hi guys i have a big question for me

i try to hide affiliate links link on this page (adult working) ( I can't add urls)

Code:
 www . ukescorts . directory / escorts / london - escorts /

or this site

www . scotlandescortsdirectory . com / aberdeen - escorts /

How they do this and hide all affiliate links behind a JS and urls look :

<a href="javascript:vU(47140)" rel="nofollow"><b>lorelei</b></a>

pls give me advice how to do this tnx.
 
Why not putting your links in a database, making a post request with the normal link -> obtain the associated affiliate link and then redirect to it. (jquery -> add a .whaterverclass to each link, preventDefaut, the gets associated link, then redirect)
 
This links are from external API so you don't know what is coming to your site
 
well even better, just make a .post{site: "urlsite"} to a php scripts getting the associated affiliate url using the api, then return the result and redirect to it.
 
yes please i will try any solution, i try find a plugin for wordpress (both sites use wodpress) but i don't see nothing.
 
well in your wordpress header you have to load the jquery and the jscript of yourself
then in your jScript file:


Code:
$( document ).ready(function() {

    $(".classofyouLinks").click(function(){

           $(this).preventDefault(); // Prevent link from working normally
           $link= $(this).attr("href"); // You get the actual link clicked
           $.post( "nameofPHPfileWhichDoesTheRest.php", { link: ""+$link } ); // You sent the link in post format to the file nameofPHPfileWhichDoesTheRest.php         
    });

}



In the nameofPHPfileWhichDoesTheRest.php file

<?php 

if(isset($_POST['link'])) {  // If data is sent properly
$link= $_POST['link'] // Get the link value

/*
Here do the API stuff to get the api affiliate link, as I don't know your api I can't tell you this exactly (Twitter, Facebook etc..) . (See cUrl on github for basic API calls)
*/
//Then redirect to the link with: 
location("Header:".$affiateLink."");

}


?>
 
unfortunately I think is to hard for me deal with this and with adultwork api. Is any script or wp plugin to do this.

tnx for help !
 
Back
Top