1

hHi,

simple and fast question:

How do I make a link in which the user will be asked if my homepage should be his defualt page in his web browser?

PassionateDeveloper
  • 14,558
  • 34
  • 107
  • 176

2 Answers2

3

This is not possible, unless you are using IE.

For IE the link would look like this:

<a target="_self" href="#" onClick="this.style.behavior='url(#default#homepage)';
                   this.setHomePage('http://www.yoursite.com');">Set Homepage</a>

User interaction is required for this (i.e going into the browser settings and intentionally setting it), and a good thing too, otherwise any link could reset my homepage.

See this SO question and answers.

Community
  • 1
  • 1
Oded
  • 489,969
  • 99
  • 883
  • 1,009
0
<script Language="JavaScript">
                                document.write('&lt;a href="javascript:history.go(0);" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://mysite.com\');"&gt;');
                                document.write('&lt;strong&gt;Click Here to make this your homepage&lt;/strong&gt;');
                            </script>

As Oded mentions, this is "IE-specific".

IrishChieftain
  • 15,108
  • 7
  • 50
  • 91