为什么图标不可见

编程入门 行业动态 更新时间:2024-10-28 17:28:24
本文介绍了为什么图标不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个脚本,它允许根据网址来显示网站图示:例

I have a script which allows to display favicons based on the url: Example

如果你看一下例子,你会看到两个环节,一个连接到谷歌和其他当红荷兰新闻网站。正如你所看到的谷歌图标是由脚本检索,而另一个则不是。这怎么可能?是什么原因造成的?如果我去的网站,我可以看到他们有一个图标。我可以在code更改为检索该图标?

If you look at the example you will see two links, one linking to Google and the other to a popular dutch news website. As you can see the Google favicon is retrieved by the script while the other is not. How is this possible? What is causing this? If I go to the website I can see they do have a favicon. What can I change in the code to retrieve this favicon?

推荐答案

由于图标为nu.nl下 www.nu.nl/images/favicon.ico

Because favicon for nu.nl is stored under www.nu.nl/images/favicon.ico

检查出快速和肮脏的解决方案: jsbin/eselap/2/edit,里面有硬codeD的URL。理想情况下,你应该请求的页面,解析它,发现图标​​的网址。

Check out quick and dirty solution: jsbin/eselap/2/edit, which has hardcoded URLs. Ideally, you should request the page, parse it and find URL of favicon.

更多推荐

为什么图标不可见

本文发布于:2023-11-15 05:03:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1591382.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图标

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!