简体   繁体   English

从html / js / css应用程序向Facebook传递消息

[英]Pass a message to facebook from a html/JS/CSS app

I am using the facebook "sharer" url from my web app, but the message part stays empty and I would like to automatically pre-fill it with some text. 我正在使用Web应用程序中的Facebook“共享者” URL,但消息部分仍然为空,我想自动用一些文本预填充它。

window.location='http://www.facebook.com/sharer.php?s=100&p[title]='+encodeURIComponent('myapp') + '&p[summary]=' + encodeURIComponent(text) + '&p[url]=' + encodeURIComponent(url) + '&p[images][0]=' + encodeURIComponent('http://www.somedomain.com/image.jpg')

How can I do this with a simple jquery function ? 如何使用简单的jquery函数做到这一点? Or maybe there is another solution than "sharer.php" for the user of my app to post on his wall directly from a button in my app ? 或者,也许还有“ Sharer.php”之外的另一种解决方案,可让我的应用程序用户直接从我的应用程序中的按钮张贴在他的墙上?

Thanks 谢谢

You will need to do a lot of reading, but the Facebook JavaScript SDK will provide what you need. 您将需要进行大量阅读,但是Facebook JavaScript SDK将提供您所需的内容。 As for publishing comments, see: https://developers.facebook.com/docs/reference/api/post/#comments 至于发布评论,请参阅: https : //developers.facebook.com/docs/reference/api/post/#comments

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

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