How to make a link that makes the page the main page or bookmark?

Is there an easy way to create a link that also does?

Basically, I would like a very simple way to do this. Any suggestions are helpful.

+3
source share
4 answers

Only in IE:

<a href="javascript:window.external.AddFavorite('http://mysite.com', 'My Site')">Bookmark This Site</a>

In firefox and IE:

function addBookmark(title, url) {
        if (window.sidebar) { // firefox
              window.sidebar.addPanel(title, url,"");
        } else if( document.all ) { //MSIE
                window.external.AddFavorite( url, title);
        } else {
               alert("Sorry, your browser doesn't support this");
        }
}

<a href="javascript:addBookmark('My Site','http://www.mysite.com')>Add bookmark</a>
+5
source

Check this box to add the site to your bookmarks.

+1
source

Javascript, . script , - , , , " " Firefox, .

, javascript, , .

+1

You can use this code to configure the page as the user's homepage.

0
source

Source: https://habr.com/ru/post/1710952/


All Articles