我已将yammer Feed添加到我的网站
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 feed嵌入选项
中提供的成功函数答案 0 :(得分:1)
您是否尝试过使用错误事件监听器?
yam.on('error', handleError);
然后可以在handleError
函数中执行将在catch块中的代码。
答案 1 :(得分:1)
yam.on('error', function(){
console.error('an error occured');
});