Created
December 19, 2013 22:37
-
-
Save diniremix/8047450 to your computer and use it in GitHub Desktop.
bookmarklet example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can be minimized using codebeautify