Have been searching for an "Add to favorites" piece of code for good 'ol html/js.
Now I am aware of the How do I add an "Add to Favorites" button or link on my website? article. But that is heavily outdated seeing it just doesn't work anymore for most browsers.
So I started this one to see if anyone has an updated piece of coding that works for 2014 at least seeing it would be nice to give my customers a chance to bookmark the pages most important to them. With this in mind it would preferably that it accepts other pages than the current page people are on. If not, than original will more than do.
This one is the original that is outdated:
<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>