Home › Forums › CSS › Appending A Data-Icon To An External Link With CSS3 › Re: Appending A Data-Icon To An External Link With CSS3
October 31, 2012 at 12:47 pm
#113044
JoniGiuro
Participant
with this snippet you get a list of all the links that don’t contain the same domain as the page you’re currently on:
var host = window.location.host;
$(‘a’).each(function(e){
var curLink = $(this);
var curLinkHref = curLink.attr(‘href’);
if(typeof curLinkHref != ‘undefined’){
if(curLinkHref.indexOf(host) == -1){
console.log(curLinkHref);
}
}
});