Emlog大前端 | 修复本站友链favicon图标不显示的方法

  • 内容
  • 相关

首先在主题目录找到 /js/main.js

/* 友情链接 favicon图标*/
$('.plinks a').each(function(){
   var imgSrc = "http://g.soz.im/"+$(this).attr('href')+'/cdn.ico?defaulticon=lightpng';
   $(this).prepend( '<img src="'+imgSrc+'">' );
})

方法一修改为

/* 友情链接 favicon图标*/
$('.plinks a').each(function(){
   var imgSrc = $(this).attr('href').substr(7).replace('/','');
   $(this).prepend( '<img src="https://f.ydr.me/'+imgSrc+'">' );
})

方法二修改为

/* 友情链接 favicon图标*/
$('.plinks a').each(function(){
   var imgSrc = $(this).attr('href').substr(7).replace('/','');
   $(this).prepend( '<img src="https://f.ydr.me/?url='+imgSrc+'">' );
})


上面的方法随便选择一个即可。

测试地址https://f.ydr.me/fishyoung.com

友链地址http://www.fishyoung.com/67.html

 您阅读这篇文章共花了:

上一篇:Linux命令行中的“瑞士军刀”

下一篇:Emlog大前端 | 文章评论通过QQ获取昵称等错误修复

本文标签:    

版权声明:本文依据CC-BY-NC-SA 3.0协议发布,若无特殊注明,本文皆为《fishyoung》原创,转载请保留文章出处。

本文链接:Emlog大前端 | 修复本站友链favicon图标不显示的方法 - http://www.fishyoung.com/post-75.html