function change_icon() {
            const changeFavicon = link => {
                let $favicon = document.querySelector('link[rel="icon"]');
                if ($favicon !== null) {
                    $favicon.href = link;
                } else {
                    $favicon = document.createElement("link");
                    $favicon.rel = "icon";
                    $favicon.href = link;
                    document.head.appendChild($favicon);
                }
            };
            // 设置图标地址
            let iconUrl = `./icoImg/1.ico`
            // 动态修改网站图标
            changeFavicon(iconUrl); 
        }

 

相关文章:

  • 2021-12-12
  • 2021-06-29
  • 2022-01-14
  • 2022-01-23
  • 2022-12-23
  • 2021-12-26
  • 2021-09-03
猜你喜欢
  • 2022-12-23
  • 2022-02-10
  • 2021-06-18
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
相关资源
相似解决方案