我为此Share Dialog制作了一个Facebook应用程序,以便从我的Web应用程序共享图像,但每当我加载页面时,我都会收到此错误:
Uncaught: h message: "invalid version specified"
我尝试解决此问题,在此处阅读一些较旧的帖子,但没有任何效果(尝试在js.src
中提供参数,使用all.js
代替sdk.js
)。以下是正文标记后面的代码:
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '224188011327825',
xfbml : true,
version : '2.8'
});
FB.AppEvents.logPageView();
};
(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/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
外部文件中的代码(Rails'application.js):
function shareFBImage() {
var imageUrl = document.getElementById("post-image").src;
FB.init({ appId: '224188011327825', status: true, cookie: true });
FB.ui(
{
method: 'share',
name: 'Facebook Dialogs',
href: $(location).attr('href'),
link: 'https://developers.facebook.com/docs/',
picture: imageUrl,
caption: '',
description: ''
},
function (response) {
if (response && response.post_id) {
alert('success');
} else {
alert('error');
}
}
);
}
答案 0 :(得分:0)
问题解决了;我在这里第二次初始化OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Application.StartupPath + "\\db\\it.accdb");
:
FB.init