简体   繁体   English

如何使用JavaScript将描述添加到Facebook之类的按钮?

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

Related to this article , I coded a simple Facebook like link as: 本文相关,我将一个简单的Facebook链接编码为:

<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 . 你不能这样做,使用sharer.php

Using the feed dialog is the easiest alternative, but for more features I'd advise using their custom OG stories API . 使用供稿对话框是最简单的选择,但是对于更多功能,我建议使用其自定义OG故事API

Just add the required Open Graph tags to the link you want to share: 只需将所需的Open Graph标签添加到您要共享的链接中即可:

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. 该消息始终必须是100%用户生成的,并且不允许预填充。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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