April 18, 201511 yr Hi all, I've been doing some research around cross browser add to favourites / bookmarks as my script didn't seem to work for Chrome or FF no more. This time I've decided to ask for help because there seems to be a lot of options out there on what to use in order to accomplish this. What do you all recommend I use / what works best? Thanks for your help in advanced.
April 19, 201511 yr Author Hi Sash, These are two I have looked at before: 1) Ultimate Add Bookmarks Script - currently using but with the FF browser the "add to sidebar box" is ticked which then loads the web site in the side bar - not what I want to achieve. I want my site to load in the tab/window; not the side bar. Otherwise this works fine in IE, Chrome etc. 2) I haven't tried the above link you gave because I'm confused as to which one is the script to use. Is it the one answered by PHP1st or the last one on the page by Alaa.kh?
April 19, 201511 yr If you don't mind using an external API. You could try http://www.addthis.com/ The free version includes a bookmark function, social network sharing and limited analytics. Edited April 19, 201511 yr by Nillervision
April 19, 201511 yr Author Thanks Nillervision but I'd rather stick with just having a script; not an api.
April 21, 201511 yr i myslef havent tested it though but it looks like this should work JQUERY <script type="text/javascript"> $(function() { $('#bookmarkme').click(function() { if (window.sidebar && window.sidebar.addPanel) { // Mozilla Firefox Bookmark window.sidebar.addPanel(document.title,window.location.href,''); } else if(window.external && ('AddFavorite' in window.external)) { // IE Favorite window.external.AddFavorite(location.href,document.title); } else if(window.opera && window.print) { // Opera Hotlist this.title=document.title; return true; } else { // webkit - safari/chrome alert('Press ' + (navigator.userAgent.toLowerCase().indexOf('mac') != - 1 ? 'Command/Cmd' : 'CTRL') + ' + D to bookmark this page.'); } }); }); </script> HTML <a id="bookmarkme" href="#" rel="sidebar" title="bookmark this page">Bookmark This Page</a>
April 21, 201511 yr i didn't know anyone used "bookmark this page" anymore. afaik it's built into the browser, any browser, any version i know that's sounds sarcastic (my groundstate i'm afraid) but, er why would you do this with additional scripting when it's there already? Edited April 21, 201511 yr by davep
Create an account or sign in to comment