Jump to content

Defer parsing of Javascript


pilotguy

Recommended Posts

Posted

Can anyone make some suggestions on the best way to achieve this?  I've been looking at my GTMetrix report and I have 3 items to improve, one being "Defer parsing of Javascript."  I've done a bit of searching and applied some code in the global template but it doesn't appear to have made a difference.

Posted

Hi,

I assume that you have already selected the option to have Javascript include location just before the /body tag in templates/edit/custom options? That should go a long way to helping out here.

Posted
2 hours ago, pilotguy said:

I just confirmed the GTmetrix a moment ago, doing another test since the last one (8 hrs prior) - The score remains 18%

You use some JS from external servers - it tells you test gtmetrix.

defer.png

Try this:

Download these JS and Upload them on your server.
Edit your code template and load these JS from your server.

This will solve your problem Defer parsing.

 

Posted

What templates actually would I be editing?  The block itself for example for the top 3 big offenders up there are YOUTUBE video embeds using iframes in a block.

Posted
1 hour ago, pilotguy said:

What templates actually would I be editing?  The block itself for example for the top 3 big offenders up there are YOUTUBE video embeds using iframes in a block.

 
 

I would probably put those in 'includeJS' under global/global in templates.

Have you thought of using a service like Cloudflare? This could have a dramatic effect on your score.

Posted
12 hours ago, pilotguy said:

What templates actually would I be editing?  The block itself for example for the top 3 big offenders up there are YOUTUBE video embeds using iframes in a block.

You have too many errors in the template. Before optimization speed you need to fix these errors. see below

html.png

In addition to these errors on the following number of rows from your source:

1073, 1109, 1143, 1181, 1215, 1249 and 1283

you have redundant closing tag "</a>"

  • 6 months later...
Posted
On 8/14/2016 at 3:10 PM, TDBF said:

Hi,

I assume that you have already selected the option to have Javascript include location just before the /body tag in templates/edit/custom options? That should go a long way to helping out here.

I didnot get how to do this?

Posted
8 hours ago, Himadri Goswami said:

I didnot get how to do this?

Go the the admin area, click on 'Customization' tab at the left-hand side and then 'Themes'.

Click on the edit button of the theme you want to change, select the 'Custom' tab and change the ' Javascript include location' option to use ' Just before </body> tag' and save.

Your JavaScript should be at the bottom of the page now.

 

  • 4 weeks later...
Posted
On 2/17/2017 at 11:11 PM, TDBF said:

Go the the admin area, click on 'Customization' tab at the left-hand side and then 'Themes'.

Click on the edit button of the theme you want to change, select the 'Custom' tab and change the ' Javascript include location' option to use ' Just before </body> tag' and save.

Your JavaScript should be at the bottom of the page now.

 

after update to latest version seems defer error for parsing of java reappeared

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...