将当前网页设为主页的代码市什么?

来源:百度知道 编辑:UC知道 时间:2024/05/21 07:37:45
如何在按钮上加代码啊?
单击按钮可以将当前的网页设为主页。

<button style="behavior:url(#default#homepage)" onClick="setHomepage(location)">设为首页</button>

脚本说明:
把如下代码加入<body>区域中
<span onclick="var strHref=window.location.href;this.style.behavior='url(#default#homepage)';this.setHomePage('http://hshlin.8u8.com');" style="CURSOR: hand"><br>将本站设置为首页</a></span>

<span onclick="var strHref=window.location.href;this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.szren.com');" style="CURSOR: hand"><br>将本站设置为首页</a></span>

as