Skip to content

Instantly share code, notes, and snippets.

@ryanckulp
Created May 31, 2017 01:53
Show Gist options
  • Save ryanckulp/e2f5664925573d9f899b8c561c76eb04 to your computer and use it in GitHub Desktop.
Save ryanckulp/e2f5664925573d9f899b8c561c76eb04 to your computer and use it in GitHub Desktop.
fomo_selz_snippet
var loadScript = function(location, callback){
var fileRef = document.createElement('script');
fileRef.setAttribute('type','text/javascript');
if (callback) {
if (fileRef.readyState) { // IE
fileRef.onreadystatechange = function() {
if (fileRef.readyState == 'loaded' || fileRef.readyState == 'complete') {
fileRef.onreadystatechange = null;
callback();
}
};
} else { // Non-IE
fileRef.onload = function(){
callback();
};
}
}
fileRef.setAttribute('src', location);
document.head.appendChild(fileRef);
};
// make sure to insert YOUR Fomo snippet "src" url below!
loadScript("https://www.usefomo.com/api/v1/XXXXXXX/load.js");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment