问题
ode :
<div id="embedded-feed" style="height: 99%; width: 100%; overflow: auto"></div>
<script src="https://assets.yammer.com/assets/platform_embed.js"></script>
<script>yam.connect.embedFeed({
container: "#embedded-feed",
network: "tcs.com",
feedType: "group",
feedId: "all"
});
</script>
Code works fine in IE and FireFox but in Chrome gives 401 Unauthorized
Console Error : GET https://www.yammer.com/tr8n/api/v1/language/translate?batch=true&source=yamjs 401 (Unauthorized)
However opening the link above link in a new tab gives proper ouput
回答1:
This is likely because you've disabled 3rd party cookies on Google Chrome at some stage -- I had the same problem.
- Browse to chrome://settings/content
- Uncheck the "Block third-party cookies and site data" checkbox
- Reload your page and the Yammer embed will likely start working
回答2:
Works for me using this script. Note SSO option in case you require.
<script type="text/javascript" src="https://assets.yammer.com/assets/platform_embed.js"></script>
<div id="embedded-feed" style="height:1000px;"></div>
<script>
yam.connect.embedFeed({
container: '#embedded-feed'
, network: 'tcs.com'
, feedType: ' '
, feedId: ' '
, config: {
use_sso: true
, header: false
, footer: false
, showOpenGraphPreview: false
, defaultToCanonical: false
, hideNetworkName: true
, promptText: 'Enter an update or question here...'
}
});
来源:https://stackoverflow.com/questions/23248749/yammer-embed-feed-works-in-ie-and-firefox-but-not-in-chrome-gives-401-unauthori