javascript – How to change my website favicon with new one-ThrowExceptions

Exception or error:

I want to change my website favicon with the new icon image but I am unable to change it. It is still showing the previous one.

Previously when I added favicon with a link tag, which was suggested from many online resources, it had worked for me. However now when I am trying to replace it with a different one, it is not changing.
I followed a StackOverflow link How do I force a favicon refresh? but still, my problem remains as it is.

That Link tag in following format:

<link rel="icon" type="image/png" href="/somewhere/myicon.png" />
How to solve:

Favicon is notorious for not refreshing, you can force your browser to redownload it by adding a querystring to your href path like so:

<link rel="icon" 
  href="/somewhere/myicon.png?v=2" />

Also try clearing your browser cache.

Leave a Reply

Your email address will not be published. Required fields are marked *