Wednesday, October 29, 2008

Using target site's favicon to distinguish external links

I was thinking about how to distinguish internal from external links and I came up with this:(jQuery)

$("a[rel='external']").each(function(){
  $("<img src='http://"
    + this.hostname+"/favicon.ico' class='icon' />")
    .prependTo(this);
});

No comments: