Skip to content

Instantly share code, notes, and snippets.

@kobvel
Created November 15, 2017 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kobvel/a79a7f751c5bb1c7a554004414861b1f to your computer and use it in GitHub Desktop.
Save kobvel/a79a7f751c5bb1c7a554004414861b1f to your computer and use it in GitHub Desktop.
var container = document.getElementById("container");
function loadApp(app) {
container.innerHTML = '';
var element = document.createElement(app);
element.onload = function (load) {
console.log('loaded', load);
};
element.onerror = function (err) {
console.error('error', err);
element.parentNode.removeChild(element);
};
container.appendChild(element);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment