1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Code snippet to add bookmark

Discussion in 'HTML & Website Design' started by Will.Spencer, Apr 4, 2005.

  1. #1
    I have this code:

    <hr><a href=": Bookmark What is a HBA?"
       ONCLICK='window.external.AddFavorite("http://www.tech-faq.com/hba.shtml","What is a HBA?");
                return false'>
       Bookmark <b>What is a HBA?</b>
    </a>
    Code (markup):
    Which generates errors like this in my Apache error logs:


    Can someone please lend me a clue? :confused: :( :confused:
     
    Will.Spencer, Apr 4, 2005 IP
  2. ScottDaMan

    ScottDaMan Peon

    Messages:
    461
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't know about the errors but my code is different.

    <a href="http://www.yoururl.com/" onclick="return external.AddFavorite(location.href, document.title)">Add to My Favorites!</a>
    Code (markup):
    But then again, it only works in IE. Perhaps this might help you. Dunno.
     
    ScottDaMan, Apr 5, 2005 IP
    Will.Spencer likes this.
  3. Will.Spencer

    Will.Spencer NetBuilder

    Messages:
    14,789
    Likes Received:
    1,040
    Best Answers:
    0
    Trophy Points:
    375
    #3
    I changed this line of code:
    <hr><a href=": Bookmark What is a HBA?"
    Code (markup):
    To this:
    <hr><a href=""
    Code (markup):
    I no longer get the cool status bar message, but I also no longer get all of those annoying error messages.

    I believe that I could add the status bar message back in using an ONMOUSEOVER, but strangely it's not worth the extra line of code to me.
     
    Will.Spencer, Apr 5, 2005 IP
  4. Will.Spencer

    Will.Spencer NetBuilder

    Messages:
    14,789
    Likes Received:
    1,040
    Best Answers:
    0
    Trophy Points:
    375
    #4
    Thanks Scott!
     
    Will.Spencer, Apr 5, 2005 IP
  5. ScottDaMan

    ScottDaMan Peon

    Messages:
    461
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Welcome! Glad to help.
     
    ScottDaMan, Apr 6, 2005 IP
  6. mikmik

    mikmik Guest

    Messages:
    356
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Here is one that puts a reminder to bookmark for Gecko, and does what you have above for IE:
    <script type="text/javascript">
    <!--
    if (navigator.appName=="Netscape") {
     document.write (
       '<span class=\"style34\">To bookmark Page,<br> click: '
      +'<b>Bookmarks | Add bookmark</b> <br>'
      +'or press <b>Ctrl+D</b>.</span>'
     )
    }
    else if (parseInt(navigator.appVersion)>3) {
     document.write (''
      +'<a onMouseOver="self.status=\'Bookmark this site\'" '
      +' onMouseOut="self.status=\'\'" '
      +' href="javascript:window.external.AddFavorite'
      +'(\'http://www.yoursite.com/id03.html\','
      +'\'Page title Yall come back now, y\'hear\')">'
      +'Bookmark this Page</a>.'
     )
    }
    //-->
    </script>
    Code (markup):
    example here, under the nav bar towards right:
    http://www.trsiyengar.com/
     
    mikmik, Apr 7, 2005 IP
  7. ScottDaMan

    ScottDaMan Peon

    Messages:
    461
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Nice code. That'll work except for those that code just enough room for "Bookmark" text and not all that text for reminding.
     
    ScottDaMan, Apr 8, 2005 IP