Skip to content

Instantly share code, notes, and snippets.

@smonteverdi
Created May 29, 2012 01:14
Show Gist options
  • Save smonteverdi/2822016 to your computer and use it in GitHub Desktop.
Save smonteverdi/2822016 to your computer and use it in GitHub Desktop.
jQuery: Display favicon next to external link
$("a[href^='http']").each(function() {
$(this).css({
background: "url(http://www.google.com/s2/u/0/favicons?domain=" + this.hostname +
") left center no-repeat",
"padding-left": "20px"
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment