Quantcast
Channel: FreelancerSpecialist
Viewing all articles
Browse latest Browse all 10

Facebook Dynamic share button url(data-href)

$
0
0
For JavaScript: <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>   To call the facebook share button: <a href=”javascript:fbshareCurrentPage()” target=”_blank” alt=”Share on Facebook”>Facebook</a>   Option: If you want a direct link instead of opening a popup window, replace the value of “escape()” to script below: window.location.href=”https://www.facebook.com/sharer/sharer.php?u=”+escape(window.location.href)+”&t=”+document.title;

Viewing all articles
Browse latest Browse all 10

Trending Articles