<html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Add BookMark it Link to your website using JavaScript</title> <script language="javascript" type="text/javascript"> function setHomepage() { //Condition to set home page in IE if (document.all) { document.body.style.behavior = 'url(#default#homepage)'; document.body.setHomePage('http://www.aspdotnet-suresh.com'); } //Condition to set home page in Mozilla else if (window.sidebar) { if (window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("this action was aviod by your browser,if you want to enable,please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true"); } } var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); prefs.setCharPref('browser.startup.homepage', 'http://www.aspdotnet-suresh.com'); } } </script> </head> <body> <form id="form1" runat="server"> <input type="button" value="set home page" onclick="setHomepage();" /> </form> </body> </html> |
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
Subscribe by RSS
Subscribe by Email
|
|||
|
|

Subscribe by RSS
Subscribe by Email
0 comments :