简体   繁体   中英

Set Facebook share title and description dynamically using addthis

addthis widget doesn't seem to integrate well with Facebook when it comes to customizing its share message.

When I try to set title and description via addthis.update, ie:

addthis.update('share', 'description', "Content to be shared" ); 

Everything works perfectly with Twitter, but Facebook is a no show, neither the template nor description/ title are being set. Using addthis:description inline attributes doesn't work either.

Also tried using meta tags without success, as suggested on Addthis Facebook description and title

Did anyone manage to sucessfully customize sharing with Facebook?

Try this:

for(var i = 0; i < addthis.links.length; i++){
   addthis.links[i].share.description = "new description";
}

That's raw access to addthis share objects properties.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM