Hi guys,
I’m looking to include a share icon that will allow users to share the page they are on to Facebook. I’ve searched around and just cannot understand the instructions for added functionality I have found on how to do this.
Can anyone give me a hand with this please.
I have my mark-up:
<ul class="socMedia">
<li class="facebook">
<a href="" onClick="shareFb()">
<script>
function shareFb() {
var sharer = "https://www.facebook.com/sharer/sharer.php?u=";
window.open(sharer + location.href, 'sharer', 'width=626,height=436');
}
</script>
Facebook
<b></b>
</a>
</li>
</ul>
This works at a basic level, however I want to add to it so the page title and a description (adding meta tags for a description on the page?) are added in the pop-up window.
Additionally, will this work on a mobile platform?