• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
Locked
0

How to really defer loading of multiple javascript

New Here ,
Dec 07, 2016 Dec 07, 2016

Copy link to clipboard

Copied

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

Views

950

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 07, 2016 Dec 07, 2016

Copy link to clipboard

Copied

LATEST

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:

bullshit!

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines