Question: [Problem](https://bugzilla.mozilla.org/show_bug.cgi?id=519028) 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) {
        var anchor = url.substr(1).replace('.html','');
        $.fizzer_anchor = anchor;
        window.location.hash = anchor;
        return anchor;
    }
});

```

The most weird thing is that if I place an alert before the window.location.hash = anchor; line, after clicking Ok favicon doesn't disappear, remove that alert() and you get your favicon disappearing.

Note: it also drops the favicon if you just do `window.location = something`.

Answer: 
It worked for me :

```
var link = document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href = 'FAV_ICON_URL';
document.getElementsByTagName('head')[0].appendChild(link);

```

Refer : [Changing Website Icon Dynamically](https://stackoverflow.com/a/260876/644011)
I noticed this behaviour, too. Every now and then Firefox drops a favicon or it refuses to put the favicon alongside my bookmark. I think this is a Firefox bug.

To workaround this (and for other functionality), I installed the [Favicon Picker add-on](https://addons.mozilla.org/en-US/firefox/addon/7849). Of course, this doesn't solve your problem on other computers, like clients and the like.