Dynamic favicon
A short essay on how to change favicon without reloading the page.
Recently, we were faced with the task of how to dynamically change Favicon without reloading the page. The decision "on the forehead", ie replacing the href value with favicon link didn’t give anything, I had to think hard and start trying all possible alternative options. The way to recreate the link node in the document worked. This managed to get work everywhere except Internet Explorer. There is a suspicion that he does not like the name of the file with the icon or its format (PNG). Link to an example UPD: Fixed some bugs in the code. Safari and IE still don't give up.
Recently, we were faced with the task of how to dynamically change Favicon without reloading the page. The decision "on the forehead", ie replacing the href value with favicon link didn’t give anything, I had to think hard and start trying all possible alternative options. The way to recreate the link node in the document worked. This managed to get work everywhere except Internet Explorer. There is a suspicion that he does not like the name of the file with the icon or its format (PNG). Link to an example UPD: Fixed some bugs in the code. Safari and IE still don't give up.
Change Favicon
/>
Change Favicon