Skip to content
Create a gist now

Instantly share code, notes, and snippets.

To avoid polluting the global namespace this uses an anonymous
function which is called with either the URL for an external
JavaScript file or a function. In either case jQuery will be loaded
from the Google CDN before your code is executed so it's free to
depend on jQuery without checking for it and can do things like
jQuery.getScript() to load other components (e.g. jQuery UI),
stylesheets, etc.
(function (target, msg) {
var loader = function() {
// Avoid executing this function twice:
if (arguments.callee._executed) return;
arguments.callee._executed = true;
if (typeof target === "function") {
} else {
var el = document.createElement('div');'absolute';'30px';'200px';'0 auto 0 auto';'0';'40%';'5px 10px 5px 10px';'#f99';
window.setTimeout( function() { jQuery(el).fadeOut('slow', function() { jQuery(this).remove(); } ); }, 2500 );
if (typeof jQuery !== 'undefined') {
} else {
var s = document.createElement('script');
s.type = "text/javascript";
s.setAttribute('src', document.location.protocol + '//');
if (s.addEventListener) {
s.addEventListener("load", loader, false);
} else if ("onreadystatechange" in s) {
s.onreadystatechange = function () {
if (this.readyState == 'complete' || this.readyState == 'loaded') { loader(); }
} else {
// Chances are if your browser is this old jQuery won't even work but just in case:
window.setTimeout(loader(), 2500);
})(function(){ jQuery('[autocomplete]').attr("autocomplete", "on"); }, "autocomplete enabled!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.