Skip to content

Instantly share code, notes, and snippets.

@atnan
Created September 1, 2008 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save atnan/8300 to your computer and use it in GitHub Desktop.
Save atnan/8300 to your computer and use it in GitHub Desktop.
(function(){
if (typeof boilerplate_bookmarklet == 'undefined') {
var stylesheet_url = 'http://example.com/bookmarklet.css';
var script_url = 'http://example.com/bookmarklet.js';
var head = document.getElementsByTagName('head')[0] || document.documentElement;
var stylesheet = document.createElement('link');
stylesheet.setAttribute('rel', 'stylesheet');
stylesheet.setAttribute('type', 'text/css');
stylesheet.setAttribute('href', stylesheet_url);
head.appendChild(stylesheet);
var script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
script.setAttribute('src', script_url);
head.appendChild(script);
} else {
boilerplate_bookmarklet.init();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment