JSFiddle - React, Tailwind, and code Playground
by 1337
HTML
<script src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
<div class="favicons">
<a href="http://www.google.com/" class="external" rel="nofollow" target="_blank">google.com</a>
</div>
JavaScript
jQuery(function ($) {
function favicognize($elink) {
$elink.before($("<img>").attr({
"src": "https://getfavicon.appspot.com/" + $elink.attr("href") + "?defaulticon=bluepng",
"width": "16px"
}).css("vertical-align", "text-bottom")).before(" ");
$elink.prev("img").attr("width", "16px");
return;
}
$("div.favicons a.external").each(function() {
favicognize($(this));
});
});