Defer parsing of JavaScript

Ask Enigma Premium Theme Installation, Settings & Configuration, Problem, Error & Bug Related Issues Here

Moderator: forum_m

Post Reply
kinsze
Posts: 22
Joined: May 2nd, 2015, 7:05 pm
Location: Toronto
Contact:

Defer parsing of JavaScript

Post by kinsze » September 19th, 2016, 11:54 pm

Hello,

I need to increase page speed loading by defer parsing of Javascript. This is the suggestion from Google's Pagespeed. Click on the link to see report: https://gtmetrix.com/reports/www.person ... m/Wn0CKENc.

The url: http://www.personaltrainertoronto.com

==================
The following are the list of js that must defer parse:
https://s.ytimg.com/yts/jsbin/player-en ... H9/base.js (1011.3KiB)
https://s.ytimg.com/yts/jsbin/player-en ... H9/base.js (1011.3KiB)
https://s.ytimg.com/yts/jsbin/www-embed ... -player.js (162.1KiB)
https://s.ytimg.com/yts/jsbin/www-embed ... -player.js (162.1KiB)
http://www.personaltrainertoronto.com/w ... /jquery.js (87.0KiB)
http://www.personaltrainertoronto.com/w ... l-6.2.1.js (57.1KiB)
http://www.personaltrainertoronto.com/w ... /envira.js (32.3KiB)
https://apis.google.com/js/plusone.js (29.7KiB)
http://www.personaltrainertoronto.com/w ... rap.min.js (23.1KiB)
http://www.personaltrainertoronto.com/w ... hotobox.js (19.1KiB)
http://www.personaltrainertoronto.com/w ... le2.min.js (18.9KiB)
http://www.personaltrainertoronto.com/w ... orm.min.js (12.5KiB)
http://www.personaltrainertoronto.com/w ... ate.min.js (7.7KiB)
http://www.personaltrainertoronto.com/w ... scripts.js (7.7KiB)
http://www.personaltrainertoronto.com/w ... nts.min.js (7.2KiB)
http://www.personaltrainertoronto.com/ (4.2KiB of inline JavaScript)
https://www.youtube.com/embed/Yhh12ckla0c (1.9KiB of inline JavaScript)
https://www.youtube.com/embed/X25vvYnmL98 (1.8KiB of inline JavaScript)
http://www.personaltrainertoronto.com/w ... -script.js (1.6KiB)
http://www.personaltrainertoronto.com/w ... bed.min.js (1.2KiB)
http://www.personaltrainertoronto.com/w ... _script.js (514B)
http://www.personaltrainertoronto.com/w ... js/menu.js (198B)
http://www.personaltrainertoronto.com/w ... -custom.js (122B)
http://www.personaltrainertoronto.com/w ... /scroll.js (72B)

========================================

How do I defer parse in the Enigma Pro Wordpress theme.

Also, here's the recommendation from Google: https://gtmetrix.com/defer-loading-of-javascript.html

====================
"...... To use this technique, you should first identify all of the JavaScript functions that are not actually used by the document before the onload event. For any file containing more than 25 uncalled functions, move all of those functions to a separate, external JS file. This may require some refactoring of your code to work around dependencies between files. (For files containing fewer than 25 uncalled functions, it's not worth the effort of refactoring.)

Then, you insert a JavaScript event listener in the head of the containing document that forces the external file to be loaded after the onload event. You can do this by any of the usual scripting means, but we recommend a very simple scripted DOM element (to avoid cross-browser and same-domain policy issues)."

==========


Please advise.

Thanks,

Kin Sze
Thanks,
Kin Sze

Post Reply

Return to “Theme Installation, Settings & Configuration, Problem, Error & Bug”