<script type= "Text/javascript" >
Set as homepage
function Sethome (obj,url) {
try{
Obj.style.behavior= ' url (#default #homepage) ';
Obj.sethomepage (URL);
}catch (e) {
if (Window.netscape) {
try{
Netscape.security.PrivilegeManager.enablePrivilege ("Universalxpconnect");
}catch (e) {
Alert ("Sorry, this operation was rejected by the browser!") \ n \ nyou Enter "About:config" in the browser address bar and return and set [Signed.applets.codebase_principal_support] to ' true ');
}
}else{
Alert ("Sorry, the browser you are using cannot complete this operation.") \ n \ nyou need to manually set the ' +url+ ' to the home page. ");
}
}
}
Bookmark this site
function addfavorite (title, URL) {
try {
Window.external.addFavorite (URL, title);
}
catch (e) {
try {
Window.sidebar.addPanel (title, URL, "");
}
catch (e) {
Alert ("Sorry, the browser you are using cannot complete this operation.") \ n \ nthe bookmark failed, please use Ctrl+d to add ");
}
}
}
Save to Desktop
function Todesktop (surl,sname) {
try {
var WshShell = new ActiveXObject ("Wscript.Shell");
var ourllink = wshshell.createshortcut (Wshshell.specialfolders ("Desktop") + "\ \" + SName + ". url");
Ourllink.targetpath = sURL;
Ourllink.save ();
}
catch (e) {
Alert ("The current IE security level does not allow operation!") ");
}
}
</script>
<a href= "javascript:void (0);" onclick= "sethome (This, ' http://www.xyz.com ');" > Homepage </a>
<a href= "javascript:void (0);" onclick= "Addfavorite (' My Site ', location.href)" > Favorites </a>
<a href= "javascript:void (0);" onclick= "Todesktop (location.href, ' My Site ')" > Save to Desktop </a>
Perfect compatible with IE,CHROME,FF's homepage, bookmark and save to desktop JS code