Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8498221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:20:38+00:00 2026-06-11T00:20:38+00:00

I have found a code snippet to pass a outbound link into a disclaimer

  • 0

I have found a code snippet to pass a outbound link into a disclaimer script on this link:

http://snipplr.com/view/28917/

$(document).ready(function() {

   // BEGIN redirect all outbound links through tracker page
   $("a").click(function(){ 

      // if it's a full URL...
      if ($(this).attr("href").indexOf("http")==0) {

         // if it doesn't go to our site
         if (!/^http(s){0,1}(.){0,3}(www){0,3}(\.){0,1}testando\.br/.test($(this).attr("href"))){

            // send it through the linkout page
            $(this).attr("href","/linkoutpage.php?p=" + $(this).attr("href"))

         }
      } 
   })
   // END redirect all outbound links through tracker page

};

But it is redirecting all the links through the script. Can somebody please help me on that? I’m testing with the domain “www.testando.br”.

Edit:
I’m trying to pass all the external links through a script without having the necessity to add “linkoutpage.php?p=THEURL” manually to all the links. Found this script, but somehow all the links are passing through it

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:20:40+00:00Added an answer on June 11, 2026 at 12:20 am

    Well, I would rewrite this script into something more clear:

    $(document).ready(function() {
      $("a").click(function() {
        var href = this.href;
        var ourDomainRegex = /^https?:\/\/(www[.])?testando[.]br/;
        // those seeking flexibility, consider this: 
        // new RegExp('^https?:\\/\\/(www[.])?'  +  ourDomain)
    
        if (href.indexOf("http") === 0   &&   ! ourDomainRegex.test(href) )
        {
          this.href = "/linkoutpage.php?p=" + href;
        }
      });
    });
    

    Here’s a fiddle to play with.

    Still, I can’t find a meaningful difference with the code you’ve given. Are you sure there’s no JavaScript error (you check the console for them)?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found this piece of code in the Haskell sendfile package: http://patch-tag.com/r/mae/sendfile/snapshot/current/content/pretty/src/Network/Socket/SendFile/Linux.hsc --
VS 2008 I have this code snippet I found on a VB website. But
I have found this code http://djangosnippets.org/snippets/2283/ but I think it doesn't work with manytomanyfields
I'm using this piece of code I found ( http://impnerd.com/wordpress-hack-add-post-images-to-your-homepage ) to display the
I have found some code snippet in the internet. But it is missing some
I have found some code on measuring execution time here http://www.dreamincode.net/forums/index.php?showtopic=24685 However, it does
I have found this code for reverse geocoding: var point = new GLatLng (lat[1],long[1]);
I want to force the download of an image. I have found this code:
I have found this line of code in a game that I study int
I have found this line of MatLab code on the internet that displays a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.