Bookmark Script for IE, Firefox

Discussion in 'JavaScript' started by AnonymousUser, Oct 3, 2008.

  1. #1
    Hey guys, Does anybody have a relativly small javasript code that bookmakrs a site when you click it.

    Id prefer it to work on multiple browsers.

    Thanks in advance
     
    AnonymousUser, Oct 3, 2008 IP
  2. Radz

    Radz Notable Member

    Messages:
    1,497
    Likes Received:
    304
    Best Answers:
    0
    Trophy Points:
    280
    #2
    
    <a href="javascript:window.external.AddFavorite('http://website.com/','Website Tital')">Add To Favorites</a>
    
    Code (markup):
    Hope it helps...
     
    Radz, Oct 3, 2008 IP
  3. AnonymousUser

    AnonymousUser Peon

    Messages:
    593
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks,but It doesnt seem to work though?
    Did you test it?
     
    AnonymousUser, Oct 3, 2008 IP
  4. Radz

    Radz Notable Member

    Messages:
    1,497
    Likes Received:
    304
    Best Answers:
    0
    Trophy Points:
    280
    #4
    i tested it on IE7, it works fine... Active X Control must be enable.
     
    Radz, Oct 3, 2008 IP
    AnonymousUser likes this.
  5. AnonymousUser

    AnonymousUser Peon

    Messages:
    593
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Ah Yes I was testing in FF, my bads, Do you have a script that works for FF too? Or could you possible modify this one? I know 0 about Javacript, Rep Added also Thanks
     
    AnonymousUser, Oct 3, 2008 IP
  6. japmedia

    japmedia Well-Known Member

    Messages:
    174
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #6
    The real script that bookmark into opera,ff and ie

    Put in header this:
    
    <script type="text/javascript">
    <!--
    /* Bookmark Modified to support Opera */
    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>
    
    Code (markup):
    Call like this

    
    <a onclick="javascript:bookmarksite('bookmarktitle', 'http://www.yoursite.com');" href="javascript:void(0);">
    
    Code (markup):
    JAP
     
    japmedia, Oct 12, 2008 IP
  7. CasinoSEO

    CasinoSEO Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hm, but FireFox opens the bookmarked adress in the sidebar. How to fix it?
     
    CasinoSEO, Oct 28, 2009 IP
  8. jamesworthy

    jamesworthy Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Not work in Opera !
     
    jamesworthy, Mar 19, 2010 IP
  9. mattinblack

    mattinblack Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Also be aware that autobookmarking scripts are no use in increasing bookmarkers this is because they always show the 'where do you want your bookmark put' dialog. Plus many pop-up blockers will stop them working as well. Far better just to write 'Press Ctrl-D NOW to bookmark this site!' which works on everything whether jscript enabled, pop-up blocked or not.
     
    mattinblack, Mar 20, 2010 IP