简体   繁体   中英

“Eliminate render-blocking JavaScript in above-the-fold content” even though all JS is at the bottom of the page?

The page in question is live at peppyburro.com/sandboxindex. I have been particularly careful to ensure all my <script> tags are out of the way of the rest of the page. To ensure that, all those tags sit together at the very end of the document, just above the closing <body> tag. And yet Google says it's blocking the above-the-fold content. What else can be done to eliminate this issue?

Here's what it looks like currently:

<body>

<!-- rest of the page -->

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="/sandboxassets_mbr/tether/tether.min.js"></script>
<script src="/sandboxassets_mbr/bootstrap/js/bootstrap.min.js"></script>
<script src="/sandboxassets_mbr/smooth-scroll/SmoothScroll.min.js"></script>
<script src="/sandboxassets_mbr/dropdown/js/script.min.js"></script>
<script src="/sandboxassets_mbr/touchSwipe/jquery.touchSwipe.min.js"></script>
<script src="/sandboxassets_mbr/bootstrap-carousel-swipe/bootstrap-carousel-swipe.min.js"></script>
<script src="/sandboxassets_mbr/jarallax/jarallax.min.js"></script>
<script src="/sandboxassets_mbr/theme/js/script.min.js"></script>
<script src="/sandboxassets/js/pb.min.js"></script>    

<iframe name="oauth2relay568119477" id="oauth2relay568119477" src="https://accounts.google.com/o/oauth2/postmessageRelay?parent=http%3A%2F%2Fwww.peppyburro.com&amp;jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_GB.D6BJotTTK3k.O%2Fm%3D__features__%2Fam%3DAQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAGLTcCMhm9y_bVe3QuOa8vncNGxJUzV-Tw#rpctoken=888376000&amp;forcesecure=1" tabindex="-1" aria-hidden="true" style="width: 1px; height: 1px; position: absolute; top: -100px;"></iframe><iframe id="rufous-sandbox" scrolling="no" frameborder="0" allowtransparency="true" allowfullscreen="true" style="position: absolute; visibility: hidden; display: none; width: 0px; height: 0px; padding: 0px; border: none;" title="Twitter analytics iframe"></iframe><script id="PIN_1487351100480.f.callback[1]" type="text/javascript" charset="utf-8" src="https://log.pinterest.com/?guid=1hSbMAVfYDeC&amp;tv=2016111001&amp;type=pidget&amp;sub=www&amp;button_count=0&amp;follow_count=0&amp;pin_count=0&amp;profile_count=0&amp;board_count=0&amp;lang=en&amp;via=http%3A%2F%2Fwww.peppyburro.com%2Fsandboxindex&amp;callback=PIN_1487351100480.f.callback[1]"></script>

</body>

There does exist some tiny bit of social media API call-scripts in the header but Google specifically named files mentioned above as culprits.

You do have some Facebook SDK, Twitter SDK, and Google Analytics script tags fairly high up in the hierarchy. Depending on what code is using them, it should be safe to move those blocks all down to the bottom of the page (above your own JavaScript files).

I'd recommend moving one at a time, starting with the GA one so as to easily identify if any change causes bugs or errors.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM