JS Code:
Copy code code as follows://Set to Home 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 was rejected by the browser.) \ nplease type "About:config" in the browser address bar and enter \ n then set 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); }else{alert ("Your browser does not support, follow these steps: 1." Open browser settings.) 2. Click the Settings page. 3. Input: "+vrl+" click OK. "); } } } Add Favorites compatible and IE6 function Shoucang (stitle,surl) {try {window.external.addFavorite (sURL, stitle);} catch (e) {try {WI Ndow.sidebar.addPanel (Stitle, sURL, "");} catch (E) {alert ("Join collection failed, add with Ctrl+d");} }
Calling code:
Copy code code as follows:
Set as homepage
|
Add to Favorites
|
Favorites and set as home code for the name style
There are some of the most basic HTML code, only for beginners to refer to.
Note: This code is only compatible with IE browser
1: Realize "
The code for the Add Favorites feature is as follows:
Copy code code as follows:
Http://www.baidu.com ', ' Baidu ') ' > Add to Favorites
You can simply change the link and station name to your own station name.
If you want to implement the mouse when you are prompted to join the collection, simply change the code to:
Copy code code as follows:
Http://www.baidu.com ', ' Baidu ') "Target=_self href= > Add to Favorites
----------------------------------
2. Set homepage code (HTML source)
Copy code code as follows: