【问题标题】:capture yammer embed error捕获 yammer 嵌入错误
【发布时间】:2015-07-20 07:29:51
【问题描述】:

我已将 yammer 提要添加到我的网站

try{      
yam.connect.embedFeed(
          { container: '#embedded-feed',
            network: 'fourleaf.com',
            feedType: 'group',                // can be 'group', 'topic', or 'user'          
            feedId: '123'                     // feed ID from the instructions above
            ,config: {
                 defaultGroupId: 3257958      // specify default group id to post to 
            }
      });  
}
catch(exception ex){
//error handling code here
}  

如果用户没有接受使用策略,yammer 将抛出未启用 x-frame 选项的错误。

我试图在 catch 块中捕获这个错误,但它没有被捕获! 我可以在控制台中看到错误,但没有调用 catch 块中的代码

或者 yammer 提要嵌入选项中是否有可用的成功功能

【问题讨论】:

    标签: javascript jquery yammer


    【解决方案1】:

    您是否尝试过使用错误事件侦听器?

    yam.on('error', handleError);
    

    catch 块中的代码然后可以在handleError 函数中执行。

    https://developer.yammer.com/docs/feed-events

    【讨论】:

      【解决方案2】:

      yammer embed 现在具有事件处理程序。在你的 catch 块或任何你想要的地方试试这个,

       yam.on('error', function(){
              console.error('an error occured');
       });
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-11-29
        • 1970-01-01
        • 1970-01-01
        • 2011-09-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多