using history.pushState in Firefox make my favicon disappear

喜你入骨 提交于 2019-12-19 07:57:06

问题


using something like

history.pushState(null, document.title, "?#");

in my site make my favicon disappear in Firefox, But it works in chrome

Is it a javascript/jQuery way to add favicon when the page is loading?


回答1:


I had similar issue in IE. Whenever I called history.replaceState() favicon disappeared. Favicon was included via link tag like this:

<link rel="shortcut icon" href="/img/resources/favicon.ico" type="image/x-icon">

After I placed favicon.ico to the root folder of my application and removed link, which pointed to it, problem with calling history.replaceState() disappeared. Hope that helps.



来源:https://stackoverflow.com/questions/24185506/using-history-pushstate-in-firefox-make-my-favicon-disappear

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!