我想使用sdk和facebook登录按钮(令牌动作)集成开放图表 问题在于智能模板tpl文件
事实上我在简单的html文件上测试了所有代码,它就像一个魅力:http://zdig1.biz/1.htm当我向tpl文件报告时,相同的代码不起作用 通过添加{literal}的corse 你可以比较其他链接 http://zdig1.biz/video/naruto-shippuden/317-video_7605be4c2.html
facebook boutton称时间线不要退出 并且公共人员不工作 <div id="fb-root"></div>
{literal}<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId : '48439698629',
channelUrl : '//zdig1.biz/channel.html',
status : true,
cookie : true,
xfbml : true
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>{/literal}
{literal}<script type="text/javascript">
function postArticle()
{
FB.api(
'me/video.watches',
'post',
{
video: "http://zdig1.biz/video/naruto-shippuuden/321-video_f69d2a355.html"
},
function(response) {
if (!response || response.error) {
alert('Post was not published.');
} else {
alert('Post was published. Action ID: ' + response.id);
}
});
}
</script>{/literal}
和行动一
<fb:login-button onlogin = 'postArticle()' perms="email,publish_actions,user_actions.video">
Timeline
</fb:login-button>
or
<fb:add-to-timeline></fb:add-to-timeline>
<form>
<input type="button" value="Publish" onclick="postArticle()" />
</form>
答案 0 :(得分:0)
解决方案是:
<fb:login-button onlogin='postlike()' perms="email,publish_actions,user_actions.video">Timeline</fb:login-button>