/**
* Creates links to social bookmarking sites.
*
* @param object container - div, span etc element to hold links.
* @param string path_to_icons - path to where the social bookmarking sites icons are.
*/
function js_create_socialBookmarks(container,path_to_icons){
var page = window.location;
var title = window.document.title;
links = new Array();
if(!path_to_icons || path_to_icons=='undefined'){
path_to_icons = './';
}
// Digg.
link = document.createElement('A');
link.href = "http://digg.com/submit?phase=2&url=" + escape(page) + "&title=" + escape(title);
link.setAttribute('title','Digg');
img = document.createElement('IMG');
img.setAttribute('src', path_to_icons + 'digg.png');
img.setAttribute('border','0');
img.setAttribute('alt','digg');
link.appendChild(img);
links[links.length] = link;
// Delicious.
link = document.createElement('A');
link.href = "http://del.icio.us/post?url=" + escape(page) + "&title=" + escape(title);
link.setAttribute('title','del.icio.us');
img = document.createElement('IMG');
img.setAttribute('src', path_to_icons + 'delicious.png');
img.setAttribute('border','0');
img.setAttribute('alt','del.icio.us');
link.appendChild(img);
links[links.length] = link;
// Stumbleupon.
link = document.createElement('A');
link.href = "http://www.stumbleupon.com/url/" + escape(page);
link.setAttribute('title','StumbleUpon');
img = document.createElement('IMG');
img.setAttribute('src', path_to_icons + 'stumbleupon.png');
img.setAttribute('border','0');
img.setAttribute('alt','StumbleUpon');
link.appendChild(img);
links[links.length] = link;
// Reddit.
link = document.createElement('A');
link.href = "http://reddit.com/submit?url=" + escape(page) + "&title=" + escape(title);
link.setAttribute('title','Reddit');
img = document.createElement('IMG');
img.setAttribute('src', path_to_icons + 'reddit.png');
img.setAttribute('border','0');
img.setAttribute('alt','Reddit');
link.appendChild(img);
links[links.length] = link;
// Technorati
link = document.createElement('A');
link.href = "http://technorati.com/faves?add=" + escape(page);
link.setAttribute('title','Technorati');
img = document.createElement('IMG');
img.setAttribute('src', path_to_icons + 'technorati.png');
img.setAttribute('border','0');
img.setAttribute('alt','Technorati');
link.appendChild(img);
links[links.length] = link;
// Furl.
link = document.createElement('A');
link.href = "http://www.furl.net/storeIt.jsp?u=" + escape(page) + "&t=" + escape(title);
link.setAttribute('title','Furl');
img = document.createElement('IMG');
img.setAttribute('src', path_to_icons + 'furl.png');
img.setAttribute('border','0');
img.setAttribute('alt','Furl');
link.appendChild(img);
links[links.length] = link;
// Slashdot.
link = document.createElement('A');
link.href = "http://slashdot.org/bookmark.pl?title=" + escape(title) + "&url=" + escape(page);
link.setAttribute('title','Slashdot');
img = document.createElement('IMG');
img.setAttribute('src', path_to_icons + 'slashdot.png');
img.setAttribute('border','0');
img.setAttribute('alt','Slashdot');
link.appendChild(img);
links[links.length] = link;
// Blinklist.
link = document.createElement('A');
link.href = "http://www.blinklist.com/index.php?Action=Blink/addblink.php&Url=" + escape(page) + "&Title=" + escape(page);
link.setAttribute('title','BlinkList');
img = document.createElement('IMG');
img.setAttribute('src', path_to_icons + 'blinklist.png');
img.setAttribute('border','0');
img.setAttribute('alt','BlinkList');
link.appendChild(img);
links[links.length] = link;
var max = links.length-1;
for(i=0;i<max;i++){
container.appendChild(links[i]);
}
}
PHP and javascript snippets you can copy and paste.
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2007
(71)
-
▼
April
(24)
- js_map_keyPress(actualKeyPress,keyPressToMatch,cal...
- js_get_keyCode(e)
- js_create_socialBookmarks(container,path_to_icons)
- js_ajax.js
- net_upload_photosToFlickr($yourFlickrEmailAddress,...
- js_is_image(ext)
- js_php_parse_url(url)
- file_do_download($fileName)
- xml_replace_nodeContent( &$node, &$new_content )
- arr_add_elementToStart($a,$el)
- fnc_call($funcName)
- sec_quote_SQLStr($sql)
- net_convert_arrayToUrlStr($arr)
- xml_get_nodeChildren($xpathObj,$path,$index=0)
- xml_get_XMLStrFromXPath($xpathObj,$path,$index=0)
- xml_remove_elementsByTagName($parentNode,$tagName)
- xml_append_childNode($parentNode,$childNode)
- xml_create_elementWithText($doc, $name, $value)
- xml_clone_xpathToNewDOM($origXPath,$path)
- xml_create_node($xml)
- xml_create_xpath($DOM)
- xml_create_DOM($xmlStr)
- xml_get_attribValue($node, $name, $default)
- xml_get_nodeSet($xpathObj,$path,$index=0)
-
▼
April
(24)
1 comment:
Tested 15 April 2007.
Post a Comment