JavaScript-less social share links

Social sharing widgets are everywhere these days and on a growing number of sites they even follow you down the page just so you're blatantly aware of where they are at all times.

As well as just being visual pollution on a webpage, these widgets are resource heavy too, chocked full of extra JavaScript which needs to be loaded for each individual widget - all of which slows your site down!

This is an issue I wrote about in my recent website redesign post and after seeing this tweet :

I thought I'd share how to create a simple share link to Facebook, Twitter & Google+ all of which can be seen in action below this post:

Facebook

  <a href="http://www.facebook.com/sharer/sharer.php?u=YOUR-URL-HERE">Share to Facebook</a>

Twitter

With Twitter - you can include additional parameters to the share link, such as some text and an associated username too:

  <a href="https://twitter.com/intent/tweet?text=SOME-CUSTOM-TEXT&url=YOUR-URL-HERE&via=YOUR-TWITTER-USERNAME">Share to Twitter</a>

Google+

  <a href="https://plusone.google.com/_/+1/confirm?hl=en&url=YOUR-URL-HERE">Share to Google+</a>

I'm sure there are similar examples for other networks out there - it's essentially just linking to the share box but with some predetermined parameters in places.

Comments

Mark Allen says:

Great post, useful reference point. If you're not using the OGP for Facebook to get the data for the share, you can send parameters like this http://www.facebook.com/sharer.php? s=100 &p[url]=http://www.mysharedsite.com &p[images][0]=http://www.mysharesite.com/img/cool-image.jpg &p[title]=My Great Title &p[summary]=Look at this great article about great things. Of course, you may want to urlencode the parameters too.

Emil says:

Great! My website was significantly slower and I had to remove it but now I can put it back!

gavsiu says:

I like how you actually implement what you talk about on your own site, unlike other blogs.