You don’t need all that code. All you need are the following lines:
<a href="https://www.facebook.com/sharer/sharer.php?u=example.org" target="_blank">
Share on Facebook
</a>
Documentation can be found at https://developers.facebook.com/docs/reference/plugins/share-links/
More Related Contents:
- FB.logout() called without an access token
- Facebook JS SDK’s FB.api(‘/me’) method doesn’t return the fields I expect in Graph API v2.4+
- org.openqa.selenium.ElementNotInteractableException: Element is not reachable by keyboard: while sending text to FirstName field in Facebook
- How does Facebook disable the browser’s integrated Developer Tools?
- facebook social plug-in not showing up when added dynamically
- Safari 3rd party cookie iframe trick no longer working?
- How to identify if a webpage is being loaded inside an iframe or directly into the browser window?
- Making facebook login work with an Android Webview
- Facebook how to check if user has liked page and show content?
- Create a file using Javascript in Chrome on client side
- Can a website know if I am running a userscript?
- How to access custom attributes from event object in React?
- Facebook “Like” button callback
- Is it possible to add a link to download a file that can only be downloaded by sharing it on Facebook?
- How to detect when facebook’s FB.init is complete
- Has Facebook sharer.php changed to no longer accept detailed parameters?
- Facebook App: localhost no longer works as app domain
- Facebook: Unsafe JavaScript issue (document.domain values should be same)
- AngularJs and Facebook Comments
- hide scrollbar and show on hover like facebook’s new chat sidebar [closed]
- How does paging in facebook javascript API work?
- Using environment variables / parameterizing config.xml
- Facebook Graph API – upload photo using JavaScript
- How to detect Facebook in-app browser?
- Is there a way to detect if the Facebook Javascript SDK loaded successfully?
- Facebook OAuth “Unsupported” in Chrome on iOS
- “Unsafe JavaScript attempt to access frame with URL…” error being continuously generated in Chrome webkit inspector
- How to add a Facebook “Like” button to an AJAX driven page
- Why isnt window.location.href= not forwarding to page using Safari?
- How could I change window’s location without reloading and # hack?