donaldsv
(Donald Sv)
September 4, 2019, 6:45pm
1
Hi there!
So I have a custom code for a Facebook share button on a CMS page and it stopped working this week… Everything was perfect for months… Any idea?
Here’s the code:
<a style="text-decoration:none; color:#ffffff; "title="Share on Facebook" class="w-inline-block social-share-btn fb" href="javascript:fbshareCurrentPage()" target="_blank" alt="Share on Facebook">
Share<img class="fb-logo" border="0" src="https://uploads-ssl.webflow.com/59b8991a7fdf9700017d5b4c/5bfd93ae15e07d17fde80cbd_facebook-f-brands.svg" width="10" style="margin-left:5px !important;" alt="Share on Facebook">
</a>
<script language="javascript">
function fbshareCurrentPage()
{window.open("https://www.facebook.com/sharer/sharer.php?u="+escape(window.location.href)+"&t="+document.title, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false; }
</script>
Thanks!
webdev
(Jeff Selser)
September 4, 2019, 7:05pm
2
I am pretty sure that sharer.php has been depreciated for quite some time. You should be using a supported method.
The Share dialog gives people the ability to publish an individual story to their timeline, a friend's timeline, a group, or in a private message on Messenger
1 Like
lauraniebel
(Laura Niebel)
September 11, 2019, 5:23am
3
Thanks for sharing this! I’m having the same issue as Donald, but I’m a bit confused with the different code options available on Facebook’s dev site. Is there another resource available somewhere for people who aren’t that JS savvy?
webdev
(Jeff Selser)
September 11, 2019, 5:37am
4
You can just use a share button.
Note to site creators: Remember that using any Facebook scripts on your site helps Facebook / and FB Advertisers track users around the web and using them should be clearly stated in your site privacy policy.
1 Like
lauraniebel
(Laura Niebel)
September 11, 2019, 7:10am
5
I’ll take a look at this. Thanks!