Skip to content

Instantly share code, notes, and snippets.

@jhrcek
Last active January 30, 2017 20:47
Show Gist options
  • Save jhrcek/2b9a9990197c29eef75269d537f94fbb to your computer and use it in GitHub Desktop.
Save jhrcek/2b9a9990197c29eef75269d537f94fbb to your computer and use it in GitHub Desktop.
Include elm-generated JS on 3rd party web page
javascript:(function() {
var elmDiv = document.createElement("div");
elmDiv.id="elm";
var elmJs = document.createElement("script");
elmJs.src="//bit.ly/2eMDpH9";
elmJs.onload=function() {
var node = document.getElementById('elm');
Elm.Main.embed(node);
};
document.body.appendChild(elmDiv);
document.body.appendChild(elmJs);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment