angularjs facebook 500 ok错误

时间:2013-10-30 05:26:56

标签: facebook angularjs

我正在使用angularjs指令进行Facebook分享。

angularjs指令控制器,我正在加载facebook javascript sdk。 angularjs指令链接功能,我显示登录,登录后,我显示共享对话框。

       link : function(scope, element, attrs){
              scope.share = function(){
                  FB.ui(
                      {
                          method: 'feed',
                          name: attrs.fbName,
                          caption: attrs.fbCaption,
                          description: attrs.fbDescription,
                          link: $location.absUrl(),
                          picture: 'http://www.fbrell.com/public/f8.jpg'
                      },
                      function(response) {
                          if (response && response.post_id) {
                              alert('Post was published successfully.');
                          } else {
                              alert('Post was not published.');
                          }
                      }
                  )
              }
              element.bind('click', function(){
                  FB.getLoginStatus(function(response) {
                      if (response.status === 'connected') {
                          scope.share();
                      } else if (response.status === 'not_authorized') {
                          alert("user is not authorized ");
                      } else {
                          FB.login(function(response) {
                              if (response.authResponse) {
                                  scope.share();
                              } else {
                                  alert("please login first");
                              }
                          });
                      }
                  });
              });
         }

它在firefox中工作,但是在chrome中,它不起作用。它正在给出HTTP 500 ok错误。

我已经搜索了很多,发现它是服务器端错误。 如何解决它或我该怎么做才能解决它?

0 个答案:

没有答案