Results 1 to 8 of 8

Thread: adding a book mark
      
   

  1. #1
    bluerovers is offline Sergeant Major
    Join Date
    Aug 2007
    Posts
    98

    Default adding a book mark

    hey all

    im trying too add a bookmark me button on my page and fell i am lost

    i downloaded the following code from a website

    bookmark(address,sitename) {
    if (window.sidebar) {
    window.sidebar.addPanel(sitename, address,"");
    } else if( document.all ) {
    window.external.AddFavorite(address, sitename);
    } else if( window.opera && window.print ) {
    return true;
    }
    }

    it also says to place this in the html header

    script type="text/javascript" src="addToFavorites.js"></script>

    and this in the body

    <a href="#" onclick="bookmark('http://javascript.internet.com/','JavaScript Source')">Bookmark our site!</a>

    i know it sounds bumb but not overly sure how to do this?

    thanks

    bluerovers
    www.bluerovers.co.nz

  2. #2
    Join Date
    Feb 2006
    Location
    Earth
    Posts
    8,721

    Default Re: adding a book mark

    1st part.
    Click on View>Page Html>Between the head, & enter this part of the code.


    <script type="text/javascript" src="addToFavorites.js"></script>

    2nd part
    Click & open the scripts button. & d/click on the script box to open. Check the radio button Java script. And enter code below.


    /* This script and many more are available free online at
    The JavaScript Source!! http://javascript.internet.com
    Created by:http://www.webbiesite.com */
    function bookmark(address,sitename) {
    if (window.sidebar) {
    window.sidebar.addPanel(sitename, address,"");
    } else if( document.all ) {
    window.external.AddFavorite(address, sitename);
    } else if( window.opera && window.print ) {
    return true;
    }
    }


    Part 3.
    Click on html box & d/click to open html properties. Enter this code.

    <a href="#" onclick="bookmark('http://javascript.internet.com/','JavaScript Source')">Bookmark our site!</a>


    Press preview to test.


    Good luck.
    PS, You will only see the Bookmark this site text.

  3. #3
    calvinngsc is offline Private First Class
    Join Date
    Aug 2007
    Posts
    5

    Default Re: adding a book mark

    Hi Chris,

    Your above step really helps.

    Thanks

    Calvin

  4. #4
    Join Date
    Feb 2006
    Location
    Earth
    Posts
    8,721

  5. #5
    bluerovers is offline Sergeant Major
    Join Date
    Aug 2007
    Posts
    98

    Default Re: adding a book mark

    collector..........you rock cheers buddy

    bluerovers
    www.bluerovers.co.nz

  6. #6
    bluerovers is offline Sergeant Major
    Join Date
    Aug 2007
    Posts
    98

    Default Re: adding a book mark

    hi as ive said, the help you get from people on this forum is first class! so i'd just like to trouble you good people again. with the above code could anyone tell me how to change thew colour of 'bookmark this site' as it is blue and i wouldn't mid a different colour

    thanks in advance

    bluerovers
    www.bluerovers.co.nz

  7. #7
    Join Date
    Feb 2006
    Location
    Earth
    Posts
    8,721

    Default Re: adding a book mark

    Hi, try this.

    <a href="#" onclick="bookmark('http://javascript.internet.com/','JavaScript Source')"><font color="green">Bookmark our site!</font></a>

    You can change the green part to a #000000 style if you want.

  8. #8
    noritauhidi is offline Corporal
    Join Date
    Nov 2007
    Posts
    10

    Default Re: adding a book mark

    Hey this worked excellent for my site on internet explorer. However when I try to use it in mozilla firefox, I can save the bookmark but when I open it, it opens it in the side bar instead of the main part of the browser. Any suggestions? I'd greatly appreciate it, I've been trying to fix this for hours.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49