Forum Moderators: open

Message Too Old, No Replies

Bookmark this entry with del.icio.us

         

Jon_King

12:25 am on Sep 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Anyone know how to do a "Add to del.icio.us" link on a website? I'd like to encourage the bookmarking of my sites.

Your help is appreciated.

SuzyUK

7:15 pm on Sep 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Found this on a favourite site (Thanks Nick)


<script language='javascript'>
document.write("<a href='http://del.icio.us/post?url=" + document.location.href + "&title=" + document.title + "'>Add to Del.icio.us</a>")
</script>

document.location.href = url/location of the page
document.title = title of page from <title> element

don't understand it all myself but it works ;)

Suzy

Jon_King

2:37 am on Sep 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ha! Thanks Nick.
Thanks Suzy!

henry0

11:17 am on Sep 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello J-K
I used that one for a while, works fine and never did I have any complaint :)

I set in a library, it is easier to have all the js in only one location and call them when needed via a library.


Name it bookmark_my_site.js

<SCRIPT LANGUAGE="JavaScript">
var txt = "Bookmark this site";
var url = "http://www.mydomain.com";
var who = "My Domain";

var ver = navigator.appName;
var num = parseInt(navigator.appVersion);
if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
document.write('<A HREF="javascript:window.external.AddFavorite(url,who);" ');
document.write('onMouseOver=" window.status=');
document.write("txt; return true ");
document.write('"onMouseOut=" window.status=');
document.write("' '; return true ");
document.write('">'+ txt + '</a>');
}else{
txt += " (Ctrl+D)";
document.write(txt);
}
</script>

PUT IT IN A LIBRARY AND CALL IT:

<script type="text/javascript" language="javascript" src="/library/bookmark_my_site.js"></script>

dcrombie

11:38 am on Sep 24, 2005 (gmt 0)



I've never understood why you'd use an 'add to bookmarks' link. Especially if it only works for a single platform or browser. For example, the key-command in different browsers could be any of: Ctrl+D, Ctrl+T, Apple+D, Apple+T and probably others.

The 'Add to del.icio.us' link makes perfect sense as in that case there's no built-in command.

henry0

12:01 pm on Sep 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Very easy answer: User experience!

In my case the site using it had a user base category that had no clue about anything tied to PC.
such as: ctrl something .. and other shortcuts

All actions needed to be triggered by an "click here"