bookmarkleter icon indicating copy to clipboard operation
bookmarkleter copied to clipboard

jQuery appended out of block scope

Open rickdog opened this issue 6 years ago • 0 comments

when using jQuery, the append into the header happens out of block scope, needs to be moved up one line:

!function($) {
    var loadBookmarklet = function($) {
        /* user script here */
    };
    if ($ && $.fn && parseFloat($.fn.jquery) >= 1.7)
        loadBookmarklet($);
    else {
        var s = document.createElement("script");
        s.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js",
        s.onload = s.onreadystatechange = function() {
            var state = this.readyState;
            state && "loaded" !== state && "complete" !== state || loadBookmarklet(jQuery.noConflict())
        }
    }
    document.getElementsByTagName("head")[0].appendChild(s) /* needs to be moved up one line */
}(window.jQuery);

rickdog avatar Jul 06 '18 02:07 rickdog