我下载了Netbeans IDE来编写HTML代码。当我运行我的代码,chrome浏览器是开放的,一切都工作得很好。我在输出浏览器日志中得到一些错误。

Failed to load resource: net::ERR_EMPTY_RESPONSE (20:00:55:963 | error, network)
at http://localhost:8383/favicon.ico

我该怎么解决呢?


当前回答

我得到了同样的喜好图标错误- 404(未找到)。我在index.html文件的<head>元素中使用了以下元素,它修复了错误:

<link rel="icon" href="data:;base64,iVBORw0KGgo=">

其他回答

对我来说,这个答案也不奏效,但这个很管用:

<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">

我复制favicon.ico到资产文件夹,它为我工作。

你可以提供你自己的图像,并在头部引用它,例如:

<link rel="shortcut icon" href="images/favicon.ico">

接受的答案不适合我,我必须给href属性添加一个值:

<link rel="shortcut icon" href="#" />

将此代码添加到页面索引中

<link rel="icon" 
      type="image/png" 
      href="http://example.com/myicon.png">