Skip to content

Instantly share code, notes, and snippets.

@johnmjackson
Created July 5, 2017 12:04
Show Gist options
  • Save johnmjackson/9c78533dbc8b9ece93d3c110ac92d790 to your computer and use it in GitHub Desktop.
Save johnmjackson/9c78533dbc8b9ece93d3c110ac92d790 to your computer and use it in GitHub Desktop.
<script>
function messengerReady() {
// Wait until the messenger is fully
// ready, then send a message
FxoMessenger.on('stateChanged', function(state) {
if (state === 'connected') {
FxoMessenger.sendMessage('Hey!');
}
});
// Subscribe to all messages received,
// logging them to the console
FxoMessenger.on('messageReceived', function(message) {
console.log(message);
});
}
</script>
<script src="https://widget.flowxo.com/embed.js?callback=messengerReady" async defer data-fxo-widget="my-own-widget-code"></script>
@fiznool
Copy link

fiznool commented Jul 6, 2017

I think if you change this to an HTML file you'll get nicer highlighting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment