I need help with Bookmarking...

  • savvart
  • Born
  • Born
  • savvart
  • Posts: 1

Post 3+ Months Ago

Hi there,

How do I create a button or link that once clicked on will automatically bookmark that site for people...???

Thanks...
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Posts: 1013
  • Loc: Living In Today

Post 3+ Months Ago

Here is a simple one done in DHTML

http://www.dynamicdrive.com/dynamicindex9/addbook.htm

BTW, Google is a wonderfull tool for finding such things :)
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

Just remember that not every browser uses similar methods.
  • conorific
  • Proficient
  • Proficient
  • User avatar
  • Posts: 350
  • Loc: NY

Post 3+ Months Ago

I'm pretty sure that's IE-only. Not cool.
  • SSH-Raj
  • Expert
  • Expert
  • User avatar
  • Posts: 588

Post 3+ Months Ago

here's one that uses cookies and automatically bookmarks for you:

oh yeah change the urls etc..

Code: [ Select ]
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
<!-- Begin
var expDays = 30;

url = "http://www.geocities.com/hotraj12m";
title = "Potter World!";

function GetCookie (name) { 
var arg = name + "="; 
var alen = arg.length; 
var clen = document.cookie.length; 
var i = 0; 
while (i < clen) {  
var j = i + alen;  
if (document.cookie.substring(i, j) == arg)   
return getCookieVal (j);  
i = document.cookie.indexOf(" ", i) + 1;  
if (i == 0) break; 

return null;
}
function SetCookie (name, value) { 
var argv = SetCookie.arguments; 
var argc = SetCookie.arguments.length; 
var expires = (argc > 2) ? argv[2] : null; 
var path = (argc > 3) ? argv[3] : null; 
var domain = (argc > 4) ? argv[4] : null; 
var secure = (argc > 5) ? argv[5] : false; 
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) + 
((domain == null) ? "" : ("; domain=" + domain)) +  
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) { 
var exp = new Date(); 
exp.setTime (exp.getTime() - 1); 
var cval = GetCookie (name); 
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
  }
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function checkCount() {
var count = GetCookie('count');
if (count == null) {
count=1;
SetCookie('count', count, exp);

if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
window.external.AddFavorite (url,title);
}
else {
var msg = "Don't forget to bookmark us!";
if(navigator.appName == "Netscape") msg += " (CTRL-D)";
alert(msg);
  }
}
else {
count++;
SetCookie('count', count, exp);
  }
}
checkCount();
// End -->
</script>
  1. <SCRIPT LANGUAGE="JavaScript">
  2. <!-- Begin
  3. <!-- Begin
  4. var expDays = 30;
  5. url = "http://www.geocities.com/hotraj12m";
  6. title = "Potter World!";
  7. function GetCookie (name) { 
  8. var arg = name + "="; 
  9. var alen = arg.length; 
  10. var clen = document.cookie.length; 
  11. var i = 0; 
  12. while (i < clen) {  
  13. var j = i + alen;  
  14. if (document.cookie.substring(i, j) == arg)   
  15. return getCookieVal (j);  
  16. i = document.cookie.indexOf(" ", i) + 1;  
  17. if (i == 0) break; 
  18. return null;
  19. }
  20. function SetCookie (name, value) { 
  21. var argv = SetCookie.arguments; 
  22. var argc = SetCookie.arguments.length; 
  23. var expires = (argc > 2) ? argv[2] : null; 
  24. var path = (argc > 3) ? argv[3] : null; 
  25. var domain = (argc > 4) ? argv[4] : null; 
  26. var secure = (argc > 5) ? argv[5] : false; 
  27. document.cookie = name + "=" + escape (value) +
  28. ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
  29. ((path == null) ? "" : ("; path=" + path)) + 
  30. ((domain == null) ? "" : ("; domain=" + domain)) +  
  31. ((secure == true) ? "; secure" : "");
  32. }
  33. function DeleteCookie (name) { 
  34. var exp = new Date(); 
  35. exp.setTime (exp.getTime() - 1); 
  36. var cval = GetCookie (name); 
  37. document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
  38. }
  39. var exp = new Date();
  40. exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
  41. function amt(){
  42. var count = GetCookie('count')
  43. if(count == null) {
  44. SetCookie('count','1')
  45. return 1
  46. }
  47. else {
  48. var newcount = parseInt(count) + 1;
  49. DeleteCookie('count')
  50. SetCookie('count',newcount,exp)
  51. return count
  52.   }
  53. }
  54. function getCookieVal(offset) {
  55. var endstr = document.cookie.indexOf (";", offset);
  56. if (endstr == -1)
  57. endstr = document.cookie.length;
  58. return unescape(document.cookie.substring(offset, endstr));
  59. }
  60. function checkCount() {
  61. var count = GetCookie('count');
  62. if (count == null) {
  63. count=1;
  64. SetCookie('count', count, exp);
  65. if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  66. window.external.AddFavorite (url,title);
  67. }
  68. else {
  69. var msg = "Don't forget to bookmark us!";
  70. if(navigator.appName == "Netscape") msg += " (CTRL-D)";
  71. alert(msg);
  72.   }
  73. }
  74. else {
  75. count++;
  76. SetCookie('count', count, exp);
  77.   }
  78. }
  79. checkCount();
  80. // End -->
  81. </script>
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

Just as a side note, automatic bookmarking of a page will make me NEVER want to return.
  • SSH-Raj
  • Expert
  • Expert
  • User avatar
  • Posts: 588

Post 3+ Months Ago

yeah but he could make a sub page to click to bookmark or edit the code.

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 85 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.