[Plz Help] How to Set-up a Button (Image) to Bookmark

Discussion in 'JavaScript' started by Darkhodge, Apr 1, 2006.

  1. #1
    Hey,


    I was just wondering how I could go about using an image as a button to bookmark the page.

    In case I didn't explain that properly, I want to set-up an image that visitors click on which would then automatically bookmark the page.

    Phew it's been a long day... I hope that made sense!


    Thanks:)
     
    Darkhodge, Apr 1, 2006 IP
  2. Slapyo

    Slapyo Well-Known Member

    Messages:
    266
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Search Google for javascript bookmark. I just did and a bunch of results showed up. You could then modify the code so that instead of some text saying to bookmark the site, you can have your image in there.
     
    Slapyo, Apr 1, 2006 IP
  3. Darkhodge

    Darkhodge Well-Known Member

    Messages:
    2,111
    Likes Received:
    76
    Best Answers:
    1
    Trophy Points:
    185
    #3
    Ah right thanks a lot - I'll look into it :)
     
    Darkhodge, Apr 1, 2006 IP
  4. Darkhodge

    Darkhodge Well-Known Member

    Messages:
    2,111
    Likes Received:
    76
    Best Answers:
    1
    Trophy Points:
    185
    #4
    Found it - well one way of doing it. I'll post it here in case others need it in the future:

    -----

    1. Place this code in between your <head> </head> tags:

    <script type="text/javascript">
    <!--
    function favoris() {
    if ( navigator.appName != 'Microsoft Internet Explorer' ){
    window.sidebar.addPanel("YOUR SITE DESCRIPTION","http://www.YOUR SITE URL.com/","");
    }
    else {
    window.external.AddFavorite("http://www.YOUR SITE URL.com/","YOUR SITE DESCRIPTION");
    }
    }
    //-->
    </script>


    2. Hyperlink the image or text to: "javascript:void(favoris());"


    That's it - hope that helps! :D
     
    Darkhodge, Apr 2, 2006 IP