Using this code I can share to Facebook using just Javascript and my own UI buttons/links etc.
FB.init({
appId : 'MyAppId',
xfbml : true,
version : 'v2.0'
});
//In my .click() method)
FB.ui(
{
method: 'share',
href: document.URL,
},
function(response){
log(response);
if (typeof response != 'undefined') {
alert('Thanks for sharing');
}
}
);
Do Twitter and Google Plus have something similar? At the moment I'm needing to use their HTML, and therefore their styling. I'd like to be able to style the "share" options I have to match the site I'm working on.
If it isn't possible through just Javascript is it possible using PHP? I'm thinking I could do an Ajax call to share the page if PHP could do this.