Website Set as homepage code
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> set the first page code </title>
<script language= "JavaScript Tutorial" >
function Sethome (OBJ,VRL) {
try{
Obj.style.behavior= ' url (#default #homepage) '; Obj.sethomepage (VRL);
}
catch (e) {
if (Window.netscape) {
try {
Netscape.security.PrivilegeManager.enablePrivilege ("Universalxpconnect");
}
catch (e) {
Alert ("This operation is rejected by the browser!") Please enter "About:config" in the browser address bar and return the value of [Signed.applets.codebase_principal_support] to ' true ' and double-click. ");
}
var prefs = components.classes[' @mozilla. Org/preferences-service;1 '].getservice ( Components.interfaces.nsIPrefBranch);
Prefs.setcharpref (' Browser.startup.homepage ', VRL);
}
}
}
</script>
<body>
<a href= "#" onclick= "Javascript:sethome (This, ' www.111cn.net ')" > Set Home </a>
<a href= "javascript:;" onclick= "this.style.behavior=" url (#default #homepage) '; This.sethomepage (' http:// Www.111cn.net '); "target=" _self "> Set as Homepage </a>
</body>