1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question about masking links in blogspot

Discussion in 'Blogging' started by Ilias, Feb 27, 2016.

Tags:
  1. Ilias

    Ilias Regular Member

    Joined:
    Jun 18, 2013
    Messages:
    355
    Likes Received:
    57
    Location:
    Morocco
  2. Asif WILSON Khan

    Asif WILSON Khan Executive VIP Jr. VIP

    Joined:
    Nov 10, 2012
    Messages:
    11,492
    Likes Received:
    32,445
    Gender:
    Male
    Occupation:
    Fun Lovin' Criminal
    Location:
    London
    Home Page:
  3. Ilias

    Ilias Regular Member

    Joined:
    Jun 18, 2013
    Messages:
    355
    Likes Received:
    57
    Location:
    Morocco
    No, I don't know how to install jquery lol. i'm not a blogger user, i just don't want to buy a hosting for this domain.
     
  4. Asif WILSON Khan

    Asif WILSON Khan Executive VIP Jr. VIP

    Joined:
    Nov 10, 2012
    Messages:
    11,492
    Likes Received:
    32,445
    Gender:
    Male
    Occupation:
    Fun Lovin' Criminal
    Location:
    London
    Home Page:
    Well I am not sure what you are trying to do.
    Which bit did you fail on? You need to edit the template I believe.
    Set up a blog and follow the instructions.
     
  5. Ilias

    Ilias Regular Member

    Joined:
    Jun 18, 2013
    Messages:
    355
    Likes Received:
    57
    Location:
    Morocco
    I need to mask some links by my own domain, it's easy to do it with wordpress but with blogger i really don't know how. i followed all the instructions but nothing happen :/
    Here's what i did
    1.png

    How can i install jquery on blogger?
    here is another article i found: http://www.ragepank.com/articles/hide-affiliate-links/
     
  6. Ilias

    Ilias Regular Member

    Joined:
    Jun 18, 2013
    Messages:
    355
    Likes Received:
    57
    Location:
    Morocco
  7. Asif WILSON Khan

    Asif WILSON Khan Executive VIP Jr. VIP

    Joined:
    Nov 10, 2012
    Messages:
    11,492
    Likes Received:
    32,445
    Gender:
    Male
    Occupation:
    Fun Lovin' Criminal
    Location:
    London
    Home Page:
    It looks like you have mixed the two scripts.

    https://developers.google.com/speed/libraries/

    Try this:

    Code:
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
    <script>
    var aff = new Array();
      
     /* define your links here */
     aff['http://www.sneeit.com/2014/05/add-jquery-to-your-blogger-and-blogspot.html'] = 'http://www.mywebsite.com/';
      
     /* do not edit below this point */
      
     /* reverse the key/value pairs so we can lookup based on value */
     var aff_reverse = new Array();
     for (k in aff) {
         aff_reverse[aff[k]] = k;
     }
      
     /* scan all links when the document loads */
     $(document).ready(function(){
       $('a').attr('href',function(){
         
         /* if the link isn't listed above, do nothing */
         if (!aff[$(this).attr('href')]) {return $(this).attr('href');}
         /* ok, the link is in our list */
         $(this).click(function(){
             /* when the link is clicked on, revert it back to the affiliate link */
             //$(this).attr('href', aff_reverse[$(this).attr('href')]);
             return true;
         });
         $(this).mouseup(function(){
             /* Firefox ignores onclick event when the link is opened via middle mouse (new tab) */
             $(this).attr('href', aff_reverse[$(this).attr('href')]);
             return true;
         });
         $(this).mouseout(function(){
             /* revert back to non-aff link in case they opened in new tab */
             $(this).attr('href', aff[$(this).attr('href')]);
             return true;
         });
         /* change the affiliate link to a non-affiliate link */
         return aff[$(this).attr('href')];
       });
     });
     </script>
    
    
     
  8. Ilias

    Ilias Regular Member

    Joined:
    Jun 18, 2013
    Messages:
    355
    Likes Received:
    57
    Location:
    Morocco
    didn't worked, is there any good free hosting allows to add your own domain? i'm going to use wordpress. I hate blogger
    I don't want to spend more money on hosting, i've already spent a lot in this month.
     
    Last edited: Feb 27, 2016
  9. Asif WILSON Khan

    Asif WILSON Khan Executive VIP Jr. VIP

    Joined:
    Nov 10, 2012
    Messages:
    11,492
    Likes Received:
    32,445
    Gender:
    Male
    Occupation:
    Fun Lovin' Criminal
    Location:
    London
    Home Page:
    Well first you could try posting in the scripting section, maybe somebody can figure it out:
    http://www.blackhatworld.com/blackhat-seo/f80-html-javascript/

    Then if you have no luck try this:
    http://lmgtfy.com/?q=site:blackhatworld.com+free+wordpress+host

    I think somebody may have recently posted a list of free wordpress hosts, so you should be able to find something.
     
    • Thanks Thanks x 1