1 Reply Latest reply on Dec 7, 2016 9:26 PM by Ussnorway

    How to really defer loading of multiple javascript

    khalidb58677985

      Hey,

       

      I'm trying to improve my site for fast loading  by Optimizing the critical rendering path

      I've inline  CSS to eliminated render blocking css...but I don't know how to Remove Renderd-Blocking JavaScript for jQuery above the fold

       

      i used Google page speed tool to find out the exact files that are currently blocking render above the fold content which is:

       

        <script type="text/javascript">
         window.jQuery || document.write('\x3Cscript src="scripts/jquery-1.8.3.min.js?crc=209076791" type="text/javascript">\x3C/script>');
      </script>
      

       

      any one please know how to defer loading of the above javascript ? or how to replace it with the below code

       

      here is the code which is recommended by most performance experts as a way to get a fast first render:

      <script type="text/javascript">
      function downloadJSAtOnload() {
      var element = document.createElement("script");
      element.src = "the name of the javascript file.js";
      document.body.appendChild(element);
      }
      if (window.addEventListener)
      window.addEventListener("load", downloadJSAtOnload, false);
      else if (window.attachEvent)
      window.attachEvent("onload", downloadJSAtOnload);
      else window.onload = downloadJSAtOnload;
      </script>
      

       

      you might get the "Defer loading of javascript" warning if you test your site using Google page speed tool

        • 1. Re: How to really defer loading of multiple javascript
          Ussnorway Adobe Community Professional

          khalidb58677985 wrote:

           

          i used Google page speed tool to find out the exact files that are currently blocking render above the fold content which is:

          ********!

           

          if you host with Adobe BC then the answer is no to anything above the body tag... you can only edit below body or add custom div, id etc... I assume most hosts will disallow what you are asking for but you could always build your own server if it really bugs you that the internet doesn't work the way Google says.

          Screenshot (459).png