<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script language="javascript" type="text/javascript">
function addFavorite()
{
if(document.all)
{
window.external.addFavorite('http://15645.rrvv.net/WishWall/index.asp','许愿墙');
}
else if(window.sidebar)
{
window.sidebar.addPanel('许愿墙','http://15645.rrvv.net/WishWall/index.asp',"");
}
}
function setHomepage()
{
if(document.all)
{
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage('http://15645.rrvv.net/WishWall/index.asp');
}
else if(window.sidebar)
{
if(window.netscape)
{
try
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}
catch(e)
{
alert("该操作被浏览器拒绝,如果想启用该功能,请在地址栏内输入 about:config, 然后将项signed.applets.codebase_principal_support值该为true");
}
}
var prefs=Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage', 'http://15645.rrvv.net/WishWall/index.asp');
}
}
</script>
</head>
<title>测试设为首页和收藏本站</title>
<body>
<a href="javascript:setHomepage();">设为首页
<a href="javascript:addFavorite();">收藏本站
</body>
</html>
设为首页和收藏本站
最新推荐文章于 2021-06-22 18:12:57 发布