Adding a share link to Facebook without using JavaScript

Posted

Recently I had to add a Facebook sharing link into a webpage where Javascript was not available, and I wasn’t sure if it was possible. After some researching I discovered that it was indeed possible if all you need is the basic functionality, and really, why would you want to overcomplicate things?

The following method should allow you to include a sharing link to Facebook without the need for any JavaScript

<a href="http://www.facebook.com/sharer/sharer.php?u=http://www.example.com" target="_blank">www.example.com</a>

There are probably more ways to share on Facebook without using JavaScript, but for now this method works just fine.