我有一个域名注册商,当做一个域名转发它包装您的网站在框架集,所以我想做的是添加一行下面的标签,以定义一个像这样的FAVICON.ICO
将%3C%2FHEAD%3E更改为%3Clink+rel%3D%27shortcut+icon%27+href%3D%27%2FPictureLibrary%2Ffavicon.ico%27+%2F%3E %3C%2FHEAD%3E
我如何使用jquery或动态javascript/html来实现这一点?
<html>
<head>
<title>smdug.tk</title>
<meta name="description" content="smdug.tk">
<meta name="keywords" content="bodyareaframe,accessible,content">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<frameset rows="*">
<frame frameborder=0 src="http://portal.merrittnet.org/smdug" name="dot_tk_frame_content" scrolling="auto" noresize>
</frameset>
</html>发布于 2014-07-24 13:43:55
javaScript代码:
<script>
icon_link = document.createElement('link'); //create an <link> tag
// add attributes to the <link> tag
icon_link.rel = 'shortcut icon';
icon_link.href = 'PictureLibrary-favicon.ico';
icon_link.type = 'image/x-icon';
// attach created <link> tag along with it's attributes to DOM
document.getElementsByTagName('head')[0].appendChild(icon_link);
</script>https://stackoverflow.com/questions/24898550
复制相似问题