midpen Posted December 20, 2009 Posted December 20, 2009 I added an "add to your favorites" link in information box: <span STYLE="cursor:hand;" onclick = "window.external.AddFavorite(location.href, document.title);"> Add this site to your favorites </span> It only works on IE, doesn't work on firefox. How to code it correctly? And, I only want customers to bookmark my index page, not document.title, how to code it? Thanks.
a.forever Posted December 20, 2009 Posted December 20, 2009 I added an "add to your favorites" link in information box: <span STYLE="cursor:hand;" onclick = "window.external.AddFavorite(location.href, document.title);"> Add this site to your favorites </span> It only works on IE, doesn't work on firefox. How to code it correctly? And, I only want customers to bookmark my index page, not document.title, how to code it? Thanks. FireFox sidebar vs Add Favorites. I googled this one in moments, so it may or may not work for you: <script type="text/javascript"> function addBookmark(title,url) { if (window.sidebar) { window.sidebar.addPanel(title, url,""); } else if( document.all ) { window.external.AddFavorite( url, title); } else if( window.opera && window.print ) { return true; } } </script> And corresponding link: <a href="#" onmousedown="addBookmark('Title','http://www.yoursite.com/')">Add this site to your favorites</a>
midpen Posted December 20, 2009 Author Posted December 20, 2009 Thank you! I added below in /includes/languages/english after defining: define('NAVBAR_TITLE', 'Add to Your Favorites'); define('HEADING_TITLE', 'Add to Your Favorites'); define('TEXT_INFORMATION', '<span STYLE="cursor:hand;" onclick = "window.external.AddFavorite(location.href, document.title);"> Add this site to your favorites </span>'); ?> It only works in IE and added the current page to the favorites. I want to know how it should be coded in order to work in FF as well and I only need to add the homepage to the favorites. I searched in google and tried, all script code does not work. Anyone could help? Thanks.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.