Closed amit-mall closed 2 years ago
@amit-mall All the methods you mentioned can be used to lazyload javascript so there is no need to call it inside the Defer() function.
Thanks for the response, It means code inside deferred script only executes, after page loads just like code inside $(window).load executes?
@amit-mall Basically you can replace the methods mentioned above with the Defer() function, to lazyload the javascript inside. Defer() improves your website load speed as well as improves SEO scores of Google Search's evaluation for your website.
ok, thanks
code inside load function is not being execute. jQuery(window).on('load', function() { //not executing }) window.addEventListener('DOMContentLoaded', (event) => { //not executing }) window.addEventListener("load", function(){ //not executing }) document.onload = function(){ //not executing })
while .ready is working