Code Snippet

Home » Code Snippets » JavaScript » Add To Favorites (IE)

Add To Favorites (IE)

<a href="http://site.com" onclick="window.external.AddFavorite(this.href,this.innerHTML);">Add Favorite and Go-To-There</a>

The first param to AddFavorite is the URL, the second the text to offer up for saving. So this inline JavaScript is reusable in the sense that it will pull those values dynamically from the anchor link itself.

Subscribe to The Thread

  1. Thank you ‘For Examples’

  2. Thanks ,
    what about set home page in IE or FF?

  3. Test that for firefox :

    onclick=”window.sidebar.addPanel(this.innerHTML,this.href,”");”

    if you use PHP or ASP you can detect browser with HTTP_USER_AGENT variable and send the correct code for make the link…

Speak, my friend

At this moment, you have an awesome opportunity* to be the person your mother always wanted you to be: kind, helpful, and smart. Do that, and we'll give you a big ol' gold star for the day (literally).

Posting tips:
  • You can use basic HTML
  • When posting code, please turn all
    < characters into &lt;
  • If the code is multi-line, use
    <pre><code></code></pre>
Thank you,
~ The Management ~