﻿(function($) { $.fn.favIconize = function(externalIconPath) { return $(this).each(function() { var href = $(this).attr('href'); var domain = href.match(/(\w+):\/\/([^\/:]+)(:\d*)?([^# ]*)/); domain = RegExp.$2; var cue = document.createElement("img"); cue.className = "faviconimg"; var cuesrc = "http://" + domain + "/favicon.ico"; cue.setAttribute("src", cuesrc); cue.onerror = function() { this.src = externalIconPath; }; $(this).after(cue); }); }; })(jQuery);
