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
Well, I would rewrite this script into something more clear:
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)?