<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><title>Add to Favorites Set homepage</title></Head><Body><Scripttype= "Text/javascript"> //Set as Home pagefunctionSethome (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 action was rejected by the browser! \ n Please enter "About:config" in the browser address bar and return to \ n then set the value of [Signed.applets.codebase_principal_support] to ' true ' and double click. "); } varprefs=components.classes['@mozilla. Org/preferences-service;1'].getservice (Components.interfaces.nsIPrefBranch); Prefs.setcharpref ('Browser.startup.homepage', VRL); }Else{alert ("your browser is not supported, follow these steps: 1. Open the browser settings. 2. Click on the Settings page. 3. Enter:"+VRL+"Click OK. "); } } } //Add to Favorites compatible with 360 and IE6functionShoucang (stitle,surl) {Try{window.external.addFavorite (sURL, stitle);}Catch(e) {Try{Window.sidebar.addPanel (Stitle, sURL,""); } Catch(e) {alert ("add to collection failed, please use ctrl+d"); } } } </Script> <Liclass= "Fore1"><ahref= "javascript:void (0)"onclick= "Sethome (this,window.location)">Set as homepage</a></Li> <Liclass= "GE">|</Li> <Liclass= "Fore2"><ahref= "javascript:void (0)"onclick= "Shoucang (document.title,window.location)">Add to Favorites</a></Li> <Liclass= "GE">|</Li> </Body></HTML>
First, copy the JS code to the page where you want to add the favorite features:
<Scripttype= "Text/javascript"> //Set as Home pagefunctionSethome (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 action was rejected by the browser! \ n Please enter "About:config" in the browser address bar and return to \ n then set the value of [Signed.applets.codebase_principal_support] to ' true ' and double click. "); } varprefs=components.classes['@mozilla. Org/preferences-service;1'].getservice (Components.interfaces.nsIPrefBranch); Prefs.setcharpref ('Browser.startup.homepage', VRL); }Else{alert ("your browser is not supported, follow these steps: 1. Open the browser settings. 2. Click on the Settings page. 3. Enter:"+VRL+"Click OK. "); } } } //Add to Favorites compatible with 360 and IE6functionShoucang (stitle,surl) {Try{window.external.addFavorite (sURL, stitle);}Catch(e) {Try{Window.sidebar.addPanel (Stitle, sURL,""); } Catch(e) {alert ("add to collection failed, please use ctrl+d"); } } } </Script>
Paste this code:
<binclass= "Fore1"><ahref= "javascript:void (0)"onclick= "Sethome (this,window.location)">Set as homepage</a></Li> <Liclass= "GE">|</Li> <Liclass= "Fore2"><ahref= "javascript:void (0)"onclick= "Shoucang (document.title,window.location)">Add to Favorites</a></Li> <Liclass= "GE">|</Li>
To add favorite features.
Add a favorite feature to your Web page