Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

Create custom Facebook share button

$
0
0

Hi 

The below code is what FB provide to create a icon share button but how i can change in the below code to use my custom image, 2nd the page that i will insert the button in is dynamically change depend on user product choice so how i can fix this case to allow code to get the full url with of the page automatically.

<div id="fb-root"></div><script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-share-button" data-href="https://developers.facebook.com/docs/plugins/" data-layout="icon"></div>




Viewing all articles
Browse latest Browse all 4850

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>