js动态设置网页icon

var currentIcon = "img/flux_favicon.ico"; //可通过后端动态获取名称
var link = document.querySelector('link[rel*="icon"]');
link.href = currentIcon;

你可能感兴趣的:(javascript,前端,html)