This sample HTML and JavaScript can be used to create links that share the current page on either Facebook, Twitter, and LinkedIn. Usage notes:
The JavaScript function setShareLinks() should be called after the DOM has loaded.
This function creates sharing links on any object in the HTML that has the class social-share and the name of a social media service – see above HTML for an example.
Setting the variable params to an empty string in the JavaScript function socialWindow() will cause these links to launch in a new window or tab rather than a pop-up.