Chaitanya Desai
Chaitanya Desai

Reputation: 323

Issue with sharing image and description via AddThis plugin in every social site

This is my code:

$('#sharethis').attr('addthis:url', "<?php echo base_url(); ?>" + "research_science/Details/" + returnedData.research_id);
$('#sharethis').attr('addthis:title', returnedData.research_name);
$('#sharethis').attr('addthis:description', returnedData.research_desc);
$('#sharethis').attr('addthis:media', "<?php echo base_url(); ?>" + returnedData.research_logo);

addthis.update('share', 'url', "<?php echo base_url(); ?>" + "research_science/Details/" + returnedData.research_id);
addthis.update('share', 'title', returnedData.research_name);
addthis.update('share', 'description', returnedData.research_desc);
addthis.update('share', 'media', "<?php echo base_url(); ?>" + returnedData.research_logo);
addthis.update('share', 'url', "<?php echo base_url(); ?>" + "research_science/Details/" + returnedData.research_id);

$(".addthis_toolbox .addthis_counter").replaceWith('<a class="addthis_counter addthis_bubble_style"></a>');
addthis.counter('.addthis_counter', null, {url: "<?php echo base_url(); ?>" + "research_science/Details/" + returnedData.research_id});

I used also used og:image property in header, but that works only for Facebook, not for other social site.

Thank you.

Upvotes: 0

Views: 453

Answers (1)

Kundan Prasad
Kundan Prasad

Reputation: 576

Google, Facebook and twitter like all social website just read source code of website. Social website not run your client-side js script; you need generate this type of tags in server side(via PHP script).

Upvotes: 1

Related Questions