FireFox 3.6 - 9 drops favicon when changing [removed]

后端 未结 3 1379
悲&欢浪女
悲&欢浪女 2021-02-02 17:43

Problem exists only on FireFox (from 3.6 up to current 9), other browsers are fine. My code looks like this:

jQuery.extend({
    AnchorFromUrl : function(url) {
         


        
3条回答
  •  逝去的感伤
    2021-02-02 18:27

    I had the same problem, but found this interesting post and it worked for me, its just adding 2 lines of javascript. The problem occure when the hash element changes, so, we need to re-stablish it via javascript

    http://kilianvalkhof.com/2010/javascript/the-case-of-the-disappearing-favicon/

    this is the code

    function setFavicon() {
      var link = $('link[type="image/x-icon"]').remove().attr("href");
      $('').appendTo('head');
    }
    

    Or (thanks to Mottie) using jQuery detach

    $('link[type*=icon]').detach().appendTo('head');
    

提交回复
热议问题