Skip to content

Instantly share code, notes, and snippets.

@mlr
Created August 11, 2022 17:02
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 mlr/822c02d3d2bd83dfee11e20c75f376bc to your computer and use it in GitHub Desktop.
Save mlr/822c02d3d2bd83dfee11e20c75f376bc to your computer and use it in GitHub Desktop.
Starter form fill bookmarklet
javascript:
var formFill = function($) {
// Fill the form fields here
// $('#myField').val('Hello world');
};
(function(e, s) {
if(typeof jQuery != 'undefined') {
console.log('jQuery already loaded');
formFill(jQuery);
return;
}
e.src = s;
e.onload = function() {
jQuery.noConflict();
console.log('jQuery injected');
formFill(jQuery);
};
document.head.appendChild(e);
})(document.createElement('script'), '//code.jquery.com/jquery-latest.min.js');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment