CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2001
    Location
    India
    Posts
    53

    Adding to IE favourites menu through code?

    How do I create a link that adds my page to the favourites menu of IE? For Netscape, I suppose it's Ctrl+D.

  2. #2
    Join Date
    Aug 2002
    Location
    Reykjavik, Iceland
    Posts
    201
    This will work for IE4+

    <html>
    <head>
    <title>My page</title>
    <script language="JavaScript" type="text/javascript">
    function addToFavorite() {
    window.external.AddFavorite(location.href, document.title);
    }
    </script>
    </head>
    <body>
    <a href="#" onclick="addToFavorite(); return false">Add this page to favorites</a>
    </body>
    </html>


    Documentation on AddFavorite() method:

    http://msdn.microsoft.com/library/de...ddfavorite.asp

    For Netscape, try to invoke the key code for control-D for the keydown event of the link.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured