ReferenceError: jQuery is not defined
-
Hello,
Thank you for creating such a quality plugin.
I recently went to pagespeed for testing, and saw that there is an error that comes from Easy Tabel of Contents:
ReferenceError: jQuery is not defined at https://mydomain.com/wp-content/plugins/easy-table-of-contents/assets/js/front.min.js?ver=2.0.56.1-1696873727:1:1
May I ask how to solve it?
I m using WP Rocket, and i have already excluded the /easy-table-of-contents/assets/js/front.min.js to be miniflied / defered / delayed, but it is still not working.Thank you.
jQuery(function(t){if("undefined"!=typeof ezTOC){function e(){if(0!==t(".ez-toc-widget-container.ez-toc-affix").length){var e=30;void 0!==ezTOC.scroll_offset&&(e=parseInt(ezTOC.scroll_offset)),t(ezTOC.affixSelector).stick_in_parent({inner_scrolling:!1,offset_top:e})}if(t.fn.shrinkTOCWidth=function(){t(this).css({width:"auto",display:"table"}),/MSIE 7\./.test(navigator.userAgent)&&t(this).css("width","")},void 0!==ezTOC.visibility_hide_by_default){var i=t(".ez-toc-toggle:not(.ez-toc-loaded),.ez-toc-widget-sticky-toggle:not(.ez-toc-loaded)"),o=ezTOC.visibility_hide_by_default;t.each(i,function(e,i){var c=t(this);t(c).addClass("ez-toc-loaded");var a=t(c).parents("#ez-toc-container,#ez-toc-widget-container,#ez-toc-widget-sticky-container").find("ul.ez-toc-list,ul.ez-toc-widget-sticky-list");t(a).hasClass("eztoc-toggle-hide-by-default")&&(o=1),Cookies?(1==Cookies.get("ezTOC_hidetoc-"+e)?t(c).data("visible",!1):t(c).data("visible",!0),Cookies.remove("ezTOC_hidetoc-"+e)):(t(c).data("visible",!0),Cookies.remove("ezTOC_hidetoc-"+e)),o&&t(c).data("visible",!1),t(c).data("visible")||a.hide(),t(c).on("click",function(i){i.preventDefault();let c=document.querySelector("#ez-toc-container");if(c)c.classList.toggle("toc_close");else{let s=document.querySelector(".ez-toc-widget-container,.ez-toc-widget-sticky-container");s.classList.toggle("toc_close")}t(this).data("visible")?(t(this).data("visible",!1),Cookies&&(o?Cookies.set("ezTOC_hidetoc-"+e,null,{path:"/"}):Cookies.set("ezTOC_hidetoc-"+e,"1",{expires:30,path:"/"})),a.hide("fast")):(t(this).data("visible",!0),Cookies&&(o?Cookies.set("ezTOC_hidetoc-"+e,"1",{expires:30,path:"/"}):Cookies.set("ezTOC_hidetoc-"+e,null,{path:"/"})),a.show("fast"))})})}var c,a,s,l=t("span.ez-toc-section").toArray(),n=(c=l,c.reduce(function(e,i){var o;return e[i.id]=t('.ez-toc-widget-container .ez-toc-list a[href="#'+t(o=i).attr("id")+'"]'),e},{})),r=t.map(n,function(t,e){return t}),d=(a=5,void 0!==ezTOC.smooth_scroll&&1===parseInt(ezTOC.smooth_scroll)&&(a=void 0!==ezTOC.scroll_offset?parseInt(ezTOC.scroll_offset):30),s=t("#wpadminbar"),s.length&&(a+=s.height()),a);function h(){var e,i,o,c,a,s=(e=d,i=l,o=t(window).scrollTop()+e+1,c=i[0],a=o-t(c).offset().top,i.forEach(function(e){var i=o-t(e).offset().top;i>0&&i<a&&(a=i,c=e)}),c);if(s){var h,f,g,z,v,u,p,b,$,w=n[s.id];(function t(e,i){i.forEach(function(t){e!==t&&t.parent().hasClass("active")&&t.parent().removeClass("active")})})(w,r),(g=(h=w).parent()).hasClass("active")||g.addClass("active"),$=(z=f=g,v=t(z),u=v.html(),v.parent().append('<li id="ez-toc-height-test" class="active">'+u+"</li>"),p=t("#ez-toc-height-test"),b=p.height(),p.remove(),b-(v.children("ul").first().height()||0)),t(".ez-toc-widget-container ul.ez-toc-list li.active").css("height",$+"px")}}function f(){t(window).off("load resize scroll",h)}l.length>0&&t(".ez-toc-widget-container").length&&t(window).on("load resize scroll",h)}t("#ez-toc-container").length&&!t("#ez-toc-container .ez-toc-toggle label span").html()&&t("#ez-toc-container .ez-toc-toggle label").html(ezTOC.fallbackIcon),ezTOC.init=function(){e()},e()}});
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘ReferenceError: jQuery is not defined’ is closed to new replies.