MrsMar
Junior Member
Posts: 226
inherit
139389
0
Sept 24, 2012 5:04:39 GMT -8
MrsMar
226
April 2009
marlis
|
Post by MrsMar on Sept 29, 2009 1:24:38 GMT -8
So i want a button to book mark this page, I have been surching google for over an hour and can't find a code that is a button, they are all text or the ones that are buttons only work in Exploror. I want it to work in at least FF too. I have found this one but I can't tell if it works. If i add it to the web page, change what i have to so it sould book make the page nothing happens. I don't have it online i just try it out in FF form the computer. But i want a button not text. Dose anyone know where i can find one. LOL, finding print page was ALOT easer... This seems to be a hard task. Thanks Marlis
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Sept 29, 2009 10:08:02 GMT -8
<script type="text/javascript"><!--
/*********************************************** * Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code * Updated Feb 8th 07' by Frankyboy to work in Opera as well. * Updated by Charles Stover to include default values and other small changes. ***********************************************/
var bookmark = function(title, url) { // Defautls if (typeof(title) == "undefined") title = document.title; if (typeof(url) == "undefined") url = location.href; // Firefox if (window.sidebar) window.sidebar.addPanel(title, url, ""); // Opera else if (window.opera && window.print) { var elem = document.createElement('a'); elem.setAttribute("href", url); elem.setAttribute("title", title); elem.setAttribute("rel", "sidebar"); elem.click(); } // Internet Explorer else if (document.all) window.external.AddFavorite(url, title); // Other? else alert("Your browser is not compatible with this form of bookmarking."); }
//--></script>
<input type="button" onclick="bookmark();" value="Bookmark This Site" /> But it didn't work in IE8. It said window.external doesn't exist. Soooo, idk. Perhaps this will work in IE7 and below:<script type="text/javascript"><!--
/*********************************************** * Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code * Updated Feb 8th 07' by Frankyboy to work in Opera as well. * Updated by Charles Stover to include default values and other small changes. ***********************************************/
var bookmark = function(title, url) { // Defautls if (typeof(title) == "undefined") title = document.title; if (typeof(url) == "undefined") url = location.href; // Firefox if (window.sidebar) window.sidebar.addPanel(title, url, ""); // Opera else if (window.opera && window.print) { var elem = document.createElement('a'); elem.setAttribute("href", url); elem.setAttribute("title", title); elem.setAttribute("rel", "sidebar"); elem.click(); } // Internet Explorer else if (window.external) window.external.AddFavorite(url, title); // Other? else alert("Your browser is not compatible with this form of bookmarking."); }
//--></script>
<input type="button" onclick="bookmark();" value="Bookmark This Site" /> I don't use bookmark scripts too much, 'cause there's a bookmark feature built into all browsers. But, good luck.
|
|
MrsMar
Junior Member
Posts: 226
inherit
139389
0
Sept 24, 2012 5:04:39 GMT -8
MrsMar
226
April 2009
marlis
|
Post by MrsMar on Oct 1, 2009 12:41:14 GMT -8
Thanks, I am using on extra pages that will open where recpies will be.
OK, i still don't know if it works or not, I have been just oping it in my browser but when i click the button nothing happens. Will it only work if it is on line?
|
|