Facebook JavaScript SDK的灵活提要对话框功能餐饮部
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Facebook JavaScript SDK的灵活提要对话框功能餐饮部相关的知识,希望对你有一定的参考价值。
A more flexible version of the 'official' Facebook feed dialog example."The Feed Dialog prompts the user to publish an individual story to a profile's feed. This does not require any extended permissions."
"The following simple javascript example demonstrates using the FB.ui method in the JavaScript SDK to use the Feed Dialog:"
<head> </head> <body> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId: "***********", channelURL : '//http://www.dr.dk/', // Channel File status: true, cookie: true, oauth : true, // enable OAuth 2.0 xfbml: true }); }; (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/da_DK/all.js'; document.getElementById('fb-root').appendChild(e); }()); function streampublish(obj) { // params: title, targethref, imgsrc, caption, description, message // set default or passed parameters obj.title = (obj.title === undefined) ? "" : obj.title; obj.targethref = (obj.targethref === undefined) ? "" : obj.targethref; obj.imgsrc = (obj.imgsrc === undefined) ? "" : obj.imgsrc; obj.caption = (obj.caption === undefined) ? "" : obj.caption; obj.description = (obj.description === undefined) ? "" : obj.description; obj.message = (obj.message === undefined) ? "" : obj.message; FB.ui( { method: 'feed', name: obj.title, link: obj.targethref, picture: obj.imgsrc, caption: obj.caption, description: obj.description, message: obj.message }/*, function(response) { if (response && response.post_id) { alert('Post was published.'); } else { alert('Post was not published.'); } }*/ ); } </script> </body> </html>
以上是关于Facebook JavaScript SDK的灵活提要对话框功能餐饮部的主要内容,如果未能解决你的问题,请参考以下文章
html Facebook Javascript SDK演示
html 异步加载Facebook JavaScript SDK
Facebook javascript SDK 分享图片问题
Facebook 登录:如何将 JavaScript 与 PHP SDK 结合起来?