0

I have tried to integrate Social media by AddThis toolbar then my requirement i need to change dynamically URL,Tittle,description,comments..etc there is one problem Facebook could not working this code it will showing blank content. Could you please help me

my code below

<script type="text/javascript">
    var addthis_share = { url: "http://www.nopcommerce.com/The clinical",        title:"test site", description: "Watch the AddThis Tour video." }

</script>
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-528c7683266cb339"></script>
<!-- AddThis Button END --> 

1 Answer 1

2

Facebook's "Share This Link" will ignore the title and description you set in the AddThis settings. Facebook's server visits the URL you specify and grabs the Open Graph headers from the page. You will need to set these headers in the HTML of the URL which you are sharing. You can find details of the headers here and here.

To demonstrate, if I set the the URL in your code to be the URL of this page, then the dialog appears like this:

enter image description here

That's because these headers are specified in the HTML source:

enter image description here

Also - there seems to be a space in the URL which you are sharing? You might want to check this.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.