在Firefox中使用history.pushState会使我的图标消失 [英] using history.pushState in Firefox make my favicon disappear

查看:170
本文介绍了在Firefox中使用history.pushState会使我的图标消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用类似于

using something like

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

在我的站点中使我的图标在Firefox中消失,但是它在chrome中工作

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

这是一个javascript / jQuery的方式来加载页面加载时的favicon?

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

推荐答案

我在IE中有类似的问题。每当我打电话history.replaceState()favicon消失。 Favicon是通过链接标签包含的:

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">

将favicon.ico放到应用程序的根文件夹中,然后移除指向它的链接,调用history.replaceState()的问题消失了。希望有帮助。

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.

这篇关于在Firefox中使用history.pushState会使我的图标消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆