Tags

, , ,

Twitter
:

var path = “”;
var text = “”;
function ShareName(title) {
if (title == “twitter”) {
path = “http://twitter.com/share?url=”;
text = “&text=”;
ShareLink(path, text);
}
}

function ShareLink(path, text) {

var title = document.title;
title = encodeString(title);
var url = document.location;
url = encodeString(url);
var link = url + text + title;
link = path + link;
window.open(link);
return false;
}

function encodeString(text) {
var output = escape(text);
output = output.replace(“+”, “%2B”);
output = output.replace(“/”, “%2F”);
return output;
}

Advertisements