我已经构建了一个AngularJS单页面应用程序并且工作正常,但它有一个问题:当网站第一次加载时,不会出现图标。如果我重新加载页面,它最终会显示出来。它在我测试的每个网络浏览器上都是一样的:Mozilla Firefox,Chrome,Chromium,IE 9,Android浏览器,iPhone for Safari。
这是SPA的共同部分:
<!DOCTYPE html>
<html lang="en" data-ng-app="vannApp" >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="Vanntile Ianito" name="author">
<base href="file:///home/vanntile/Documents/doc/WEB_DEVELOPING/Vann_Original/index.html">
<link rel="shortcut icon" href="icon/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="icon/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="icon/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="icon/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="icon/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="icon/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="icon/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="icon/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="icon/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="icon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="icon/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="icon/favicon-194x194.png" sizes="194x194">
<link rel="icon" type="image/png" href="icon/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="icon/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="icon/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="icon/manifest.json">
<title>Website Title</title>
<link href="css/vannstyle.min.css" rel="stylesheet">
<script src="js/angular/angular.min.js"></script>
<script src="js/angular/ui-bootstrap-tpls-0.12.1.min.js"></script>
<script src="js/angular/angular-route.min.js"></script>
<script src="js/angular/angular-animate.min.js"></script>
<script src="js/angular/index.js"></script>
</head>
<body>
<p>This is some text. I could have thought of something better, but I'm lazy.</p>
</body>
</html>
赞助是用Real favicon Generator制作的。 Microsoft磁贴由Windows 8.1 tile制作。它们不在网站的根目录中,而是在 / icon 。
任何帮助将不胜感激。提前谢谢。
答案 0 :(得分:5)
您必须首先从favicon元标记中添加 favicon.ico 元标记。以谷歌页面为例:
<!DOCTYPE html>
<html lang="en" data-ng-app="vannApp" >
<head>
<meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image">
<link href="/images/branding/product/ico/googleg_lodp.ico" rel="shortcut icon">
答案 1 :(得分:2)
可能是favicon未放置在网站的根目录中。尝试更改其文件夹,看看它是否仍然存在。