我正在使用Facebook JavaScript SDK。它之前正在工作,但突然间它会抛出异常,我无法追查错误。这是代码:
<script src="http://connect.facebook.net/en_US/all.js" type="text/javascript"></script>
<script type="text/javascript">
FB.init({ appId: "MY-APP-ID", status: true, cookie: true,xfbml:true,oauth:true });
function postToFeed() {
// Calling the API
var obj = {
method: 'feed',
link: 'URL',
picture: 'http://fbrell.com/f8.jpg',
name: 'myappname',
caption: 'Reference Documentation',
description: 'Using Dialogs to interact with users.'
};
function callback(response) {
alert(response);
}
FB.ui(obj, callback);
}
</script>
<a onclick="postToFeed(); return false;" href="javascript:void(0);">Share on Facebook</a>
我该如何解决这个问题?