<!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" />
<title>设为首页--加入收藏--建站学 www.jzxue.com</title>
<script type="text/javascript">
function setHomePage(obj){
var aUrls=document.URL.split("/");
var vDomainName="http://"+aUrls[2]+"/";
try{//IE
obj.style.behavior="url(#default#homepage)";
obj.setHomePage(vDomainName);
}catch(e){//other
if(window.netscape) {//ff
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}
catch (e) {
alert("此操作被浏览器拒绝!\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'");
}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage',vDomainName);
}
}
if(window.netscape)alert("ff");
}
function addFavorite(){
var aUrls=document.URL.split("/");
var vDomainName="http://"+aUrls[2]+"/";
var description=document.title;
try{//IE
window.external.AddFavorite(vDomainName,description);
}catch(e){//FF
window.sidebar.addPanel(description,vDomainName,"");
}
}
</script>
</head>
<body>
<input type="button" value="设为首页" onclick="setHomePage(this);" /> <input type="button" value="加入收藏" onclick="addFavorite();" />
</body>
</html>
(责任编辑:admin)