"Click here to set as homepage" how can I do this?

Discussion in 'Programming' started by RHIMLER14, Aug 25, 2008.

  1. #1
    Just as the title says.....thanks!
     
    RHIMLER14, Aug 25, 2008 IP
  2. ipro

    ipro Active Member

    Messages:
    101
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    <script language="JavaScript">
    function bookmark(url,title){
      if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
      window.external.AddFavorite(url,title);
      } else if (navigator.appName == "Netscape") {
        window.sidebar.addPanel(title,url,"");
      } else {
        alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
      }
    }
    </script>
    <a href="javascript:bookmark_page('http://www.site.com','Bookmark Text');">
    Bookmark this Page</a>
    
    HTML:
    put that code on your website

    cheers
     
    ipro, Aug 26, 2008 IP
  3. SearchBliss

    SearchBliss Well-Known Member

    Messages:
    1,899
    Likes Received:
    70
    Best Answers:
    2
    Trophy Points:
    195
    Digital Goods:
    1
    #3
    Here's another one that only shows in IE, so there is no "dead" link, AND includes a "Bookmark us" link.
    <!--[if IE]>
    <script type="text/javascript">
    if (document.all)
    document.write('<a href="javascript:addbookmark()">Bookmark us!</a><br>')
    </script>
    <a class="chlnk" HREF onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.YOURSITE.com');">Set your homepage to SITE TITLE</a>
    <![endif]-->
    Code (markup):
     
    SearchBliss, Aug 26, 2008 IP
  4. desman

    desman Guest

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    As far as I know, this will only work for Internet Explorer so you might want to post instructions on your site for Firefox or other browser users.
     
    desman, Aug 26, 2008 IP
  5. eponus

    eponus Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Just tell them to hit Ctrl + D.
     
    eponus, Aug 27, 2008 IP
  6. RHIMLER14

    RHIMLER14 Peon

    Messages:
    431
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I just did a DRAG to HOME icon thing...works for all browsers....
     
    RHIMLER14, Aug 28, 2008 IP