• Resolved joelmellin

    (@joelmellin)


    Hi,

    In developers.google.com I get an jQuery error that comes when I have WP Optimize activated and enable minification and merging of Javascript files in WP Optimize.
    This is the offending code. The first jQuery is not defined.

    
    public function addScriptsLisener() {
    $js = ‘var v = jQuery.fn.jquery;
    if (v && parseInt(v) >= 3 && window.self === window.top) {
    var readyList=[];
    window.originalReadyMethod = jQuery.fn.ready;
    jQuery.fn.ready = function(){
    if(arguments.length && arguments.length > 0 && typeof arguments[0] === “function”) {
    readyList.push({“c”: this, “a”: arguments});
    }
    return window.originalReadyMethod.apply( this, arguments );
    };
    window.wpfReadyList = readyList;
    }’;
    wp_add_inline_script(‘jquery’, $js, ‘after’);
    }
    
    • This topic was modified 1 month, 1 week ago by Yui.
    • This topic was modified 1 month, 1 week ago by Yui. Reason: please use CODE button for code formatting

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.