Contact us

March 22, 2006

Firefox add to favorites code

Filed under: seoKevin Gibbons @ 12:49 pm

I have updated the javascript code, below, for my website as I noticed the add to favourites link didn’t bookmark websites in Firefox. I have now updated the code so that this is compatible with both Firefox and IE but I’ve noticed this is opening the url in the sidebar window instead of a full browser page. If anyone knows how to fix this please let me know as so far I’ve only found examples which do the same or only work in IE.

Firefox add to favorites code:
<script type=”text/javascript”>
function bookmarksite(){
if (document.all)
window.external.AddFavorite(location.href, document.title);
else if (window.sidebar)
window.sidebar.addPanel(document.title, location.href, “”)
}
<% /script>
<% a href=”javascript:bookmarksite()”> Add to favorites< /a>

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Propeller
  • NewsVine
  • Reddit
  • StumbleUpon
  • Technorati
  • TwitThis

5 Comments »

  1. thanks, works well

    Comment by Anonymous — December 3, 2006 @ 12:29 am

  2. Do you know the code for Safari and Opera? just curious.

    Comment by Pradeep — April 16, 2007 @ 8:43 pm

  3. Not tested but I believe the code for safari would be something like:

    a href=http://www.google.com” title=”Google web search” rel=”sidebar”

    As for Safari I have no idea, I found this page while googling how to do it in Safari.

    Comment by Anonymous — April 29, 2007 @ 9:44 pm

  4. it dosent work

    Comment by brandon — July 31, 2007 @ 9:17 pm

  5. thanks for code..i will use it.

    Comment by offshore software development — September 15, 2007 @ 6:24 am

Leave a comment

"If we knew what it was we were doing, it would not be called research, would it?"Albert Einstein (1879 - 1955)