Fedge No
Jump to Content
Home
Web Links
Computer Security Services
Chat
Music
Video
Images
Documents
Articles
Facebook Stuff
Contact
Friends
Share Javascript
Javascript functions to share on Facebook, MySpace and Twitter. More sites to be added soon.
function myspaceShare() { var i, description, tags, targetUrl; tags = document.getElementsByTagName('meta'); if (tags) { for (i = 0; i < tags.length; i = i + 1) { if (tags[i].getAttribute('name') === 'description') { description = tags[i].getAttribute('content'); } } } else { description = document.title; } targetUrl = 'http://www.myspace.com/index.cfm?fuseaction=postto&' + 't=' + encodeURIComponent(document.title) + '&c=' + encodeURIComponent(description.substring(0, 340)) + '&u=' + encodeURIComponent(document.location.href) + '&r=' + encodeURIComponent(document.location.href); window.open(targetUrl); } function twitterShare() { window.open('http://twitter.com?status=' + encodeURIComponent(document.title + ' - ' + document.location)); } function facebookShare() { var d = document, f = 'http://www.facebook.com/share', p = '.php?src=bm&v=4&i=1259575049&u=' + encodeURIComponent(document.location.href) + '&t=' + encodeURIComponent(d.title); function a() { if (!window.open(f + 'r' + p, 'sharer', 'toolbar=0,status=0,resizable=1,width=626,height=436')) { document.location.href = f + p; } } if (/Firefox/.test(navigator.userAgent)) { setTimeout(a, 0); } else { a(); } }