Skip to content

Instantly share code, notes, and snippets.

@tallykatt
Forked from elidupuis/bookmarklet.js
Created December 17, 2016 04:56
Show Gist options
  • Save tallykatt/3532fd5afae4a4c1fee0107dd0413851 to your computer and use it in GitHub Desktop.
Save tallykatt/3532fd5afae4a4c1fee0107dd0413851 to your computer and use it in GitHub Desktop.
How to create a bookmarklet with an external js file.
// use this code as your href attribute on your 'Install this bookmarklet' anchor tag.
// borrowed from http://net.tutsplus.com/tutorials/javascript-ajax/create-bookmarklets-the-right-way/
javascript:(function(){var jsCode = document.createElement('script');jsCode.setAttribute('src', 'http://example.com/path/to/file.js');document.body.appendChild(jsCode);}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment