Skip to content

Instantly share code, notes, and snippets.

@diniremix
Created December 19, 2013 22:37
Show Gist options
  • Save diniremix/8047450 to your computer and use it in GitHub Desktop.
Save diniremix/8047450 to your computer and use it in GitHub Desktop.
bookmarklet example
javascript: (function() {
function cargarDatos() {
var $ = jQuery.noConflict(true),
username = "admin",
password = "password";
$('#username').trigger('focus').val(username);
$('#password').trigger('focus').val(password);
$('#remerberMe').trigger('focus').attr('checked',true);
}
var version = "1.7.1";
if (window.jQuery === undefined || window.jQuery.fn.jquery < version) {
var ready = false,
script = document.createElement("script");
script.src = "https://ajax.googleapis.com/ajax/libs/jquery/" + version + "/jquery.min.js";
script.onload = script.onreadystatechange = function() {
!ready && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") && (ready = true, cargarDatos())
};
document.getElementsByTagName("head")[0].appendChild(script);
}
else {
cargarDatos();
}
})();
@diniremix
Copy link
Author

can be minimized using codebeautify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment