{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"never","params":[],"results":{"codes":[]},"settings":"","try":true,"basic_auth":false},"next":{"description":"","pages":[]},"title":"Classic Embed Events","type":"basic","slug":"feed-events","excerpt":"","body":"Classic Embed supports an event system that developers can use to handle specific scenarios from the page that hosts the Embed component. For example, a developer can display additional information when errors occur, such as recommending that a user reports these to a help desk.\n\n### Registering for events ###\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \" yam.on(eventId, callbackFunction, [context]);\",\n      \"language\": \"javascript\",\n      \"name\": \"Start listening to an event\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"yam.off(eventId, callbackFunction, [context]);\",\n      \"language\": \"javascript\",\n      \"name\": \"Stop listenting to an event\"\n    }\n  ]\n}\n[/block]\n### Arguments ###\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"eventId\",\n    \"1-0\": \"callbackFunction\",\n    \"2-0\": \"context\",\n    \"h-0\": \"Argument\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Identifier of the event (see list below)\",\n    \"1-1\": \"JavaScript function that handles the event.\",\n    \"2-1\": \"An optional object that contains state that is passed to your function handler.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\n### Available events ### \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Event Name\",\n    \"h-1\": \"Event Id\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"Error\",\n    \"0-1\": \"error\",\n    \"0-2\": \"An error has occurred while loading the embed component.\",\n    \"1-0\": \"Logged In\",\n    \"1-1\": \"/embed/loggedIn\",\n    \"1-2\": \"The user has logged in to Yammer via the embed component.\",\n    \"2-0\": \"Logged Out\",\n    \"2-1\": \"/embed/loggedOut\",\n    \"2-2\": \"The user has logged out from Yammer via the embed component.\",\n    \"3-0\": \"Loading Completed\",\n    \"3-1\": \"/embed/feed/loadingCompleted\",\n    \"3-2\": \"The embed component has completed loading and is ready to display.\",\n    \"4-0\": \"(All)\",\n    \"4-1\": \"all\",\n    \"4-2\": \"Captures all events listed above as they are triggered from the embed component.\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]","updates":["553f899a6a7d010d0057c847","5575e547acd0472d000aca46"],"order":4,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"547382311a20c70800e1897a","project":"545137a814af501a00b50cf9","parentDoc":null,"createdAt":"2014-11-24T19:08:33.660Z","githubsync":"","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["545137a814af501a00b50cfd","545138eaa66f020800dbab4a","546b9072b47b5d1400109edf","546b9082b47b5d1400109ee0","546b9088b47b5d1400109ee1","546b909462515a14007ebc43","546b90a0b47b5d1400109ee2","546ced235884600e007a92f6","5481008eea7fd40b00cd7c2b","573b9d83ee2b3b220042291f","57be1efa15efc70e006a5f99","5ee004f52c97b4004c7a5876"],"_id":"545137a814af501a00b50cfc","project":"545137a814af501a00b50cf9","__v":12,"createdAt":"2014-10-29T18:53:28.525Z","releaseDate":"2014-10-29T18:53:28.525Z"},"__v":9,"user":"5433099f9a2b451a00ad4531","category":{"sync":{"isSync":false,"url":""},"pages":["54737d5f1a20c70800e1895f","54737d801a20c70800e18961","54737d95007eb108007e03a8","547381da007eb108007e03c7","547382311a20c70800e1897a","55761ac11ce9e6370050137b"],"title":"Yammer Embed","slug":"yammer-embed","order":7,"from_sync":false,"reference":false,"_id":"546b9082b47b5d1400109ee0","project":"545137a814af501a00b50cf9","version":"545137a814af501a00b50cfc","__v":6,"createdAt":"2014-11-18T18:31:30.383Z"}}

Classic Embed Events


Classic Embed supports an event system that developers can use to handle specific scenarios from the page that hosts the Embed component. For example, a developer can display additional information when errors occur, such as recommending that a user reports these to a help desk. ### Registering for events ### [block:code] { "codes": [ { "code": " yam.on(eventId, callbackFunction, [context]);", "language": "javascript", "name": "Start listening to an event" } ] } [/block] [block:code] { "codes": [ { "code": "yam.off(eventId, callbackFunction, [context]);", "language": "javascript", "name": "Stop listenting to an event" } ] } [/block] ### Arguments ### [block:parameters] { "data": { "0-0": "eventId", "1-0": "callbackFunction", "2-0": "context", "h-0": "Argument", "h-1": "Description", "0-1": "Identifier of the event (see list below)", "1-1": "JavaScript function that handles the event.", "2-1": "An optional object that contains state that is passed to your function handler." }, "cols": 2, "rows": 3 } [/block] ### Available events ### [block:parameters] { "data": { "h-0": "Event Name", "h-1": "Event Id", "h-2": "Description", "0-0": "Error", "0-1": "error", "0-2": "An error has occurred while loading the embed component.", "1-0": "Logged In", "1-1": "/embed/loggedIn", "1-2": "The user has logged in to Yammer via the embed component.", "2-0": "Logged Out", "2-1": "/embed/loggedOut", "2-2": "The user has logged out from Yammer via the embed component.", "3-0": "Loading Completed", "3-1": "/embed/feed/loadingCompleted", "3-2": "The embed component has completed loading and is ready to display.", "4-0": "(All)", "4-1": "all", "4-2": "Captures all events listed above as they are triggered from the embed component." }, "cols": 3, "rows": 5 } [/block]