简体   繁体   中英

How can I add description to Facebook like button using JavaScript?

Related to this article , I coded a simple Facebook like link as:

<a href="JavaScript:window.open('http://www.facebook.com/sharer.php?u=http://jsfiddle.net','','width=657,height=400,scrollbars=1')">Like</a>

How can I add a personal description?

You can't do that using sharer.php anymore .

Using the feed dialog is the easiest alternative, but for more features I'd advise using their custom OG stories API .

Just add the required Open Graph tags to the link you want to share:

That being said, if you want to add a "message", that´s not possible at all and not allowed anyway. The message always must be 100% user generated and prefilling is not allowed.

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