Skip to content

Instantly share code, notes, and snippets.

@sbilodeau
Last active July 24, 2018 19:27
Show Gist options
  • Save sbilodeau/63c7587f125f668684fb to your computer and use it in GitHub Desktop.
Save sbilodeau/63c7587f125f668684fb to your computer and use it in GitHub Desktop.
Slaask with requireJS workaround
define(['require', 'https://cdn.slaask.com/chat.js'], function(require, platform) {
window.platform = platform;
window._slaask = new window.slaaskApp();
window._slaask.createScriptTag = function (url) {
var app = this;
var virtualStriptTag = {};
require([url], function(emoji) {
if(!app.emoji)
app.emoji = emoji;
if(virtualStriptTag.onload)
virtualStriptTag.onload();
});
return virtualStriptTag;
};
return window._slaask;
});
@sbilodeau
Copy link
Author

Check this simpler one using only script tag
https://gist.github.com/sbilodeau/29c8016b67485614944e

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