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.

Why only can Add to Favorites for IE Bookmark but not FF?

Discussion in 'JavaScript' started by JJnacy, Jun 12, 2009.

  1. #1
    I need the code can add to Favorites IE and Firefox bookmarks.

    I have this one but only work for IE.
    <a href="javascript:window.external.addFavorite('http://URL/','Title')">
    <font>Add the site to favor links (bookmark)</font></a>


    How to write for IE and FF?


    Thanks
    SEMrush
     
    JJnacy, Jun 12, 2009 IP
    SEMrush
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    hi
    <head>
    <script language="javascript">
    <!--
    function bookmarksite(title,url){
    if (window.sidebar) // firefox
    window.sidebar.addPanel(title, url, "");
    else if(window.opera && window.print){ // opera
    var elem = document.createElement('a');
    elem.setAttribute('href',url);
    elem.setAttribute('title',title);
    elem.setAttribute('rel','sidebar');
    elem.click();
    }
    else if(document.all)// ie
    window.external.AddFavorite(url, title);
    }
    -->

    </script>


    </head>

    <body>
    <!-- Donot change anything Above this Line,only change is description and url in the function given below -->
    <a class="pdfbycat" href="javascript:bookmarksite('discription for bookmark', url')">Bookmark Us</a>
     
    kmap, Jun 12, 2009 IP
    JJnacy likes this.