Defer parsing of JavaScript

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

Moderator: forum_m

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

Defer parsing of JavaScript

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


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: ... m/Wn0CKENc.

The url:

The following are the list of js that must defer parse: ... H9/base.js (1011.3KiB) ... H9/base.js (1011.3KiB) ... -player.js (162.1KiB) ... -player.js (162.1KiB) ... /jquery.js (87.0KiB) ... l-6.2.1.js (57.1KiB) ... /envira.js (32.3KiB) (29.7KiB) ... rap.min.js (23.1KiB) ... hotobox.js (19.1KiB) ... le2.min.js (18.9KiB) ... orm.min.js (12.5KiB) ... ate.min.js (7.7KiB) ... scripts.js (7.7KiB) ... nts.min.js (7.2KiB) (4.2KiB of inline JavaScript) (1.9KiB of inline JavaScript) (1.8KiB of inline JavaScript) ... -script.js (1.6KiB) ... bed.min.js (1.2KiB) ... _script.js (514B) ... js/menu.js (198B) ... -custom.js (122B) ... /scroll.js (72B)


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

Also, here's the recommendation from Google:

"...... 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.


Kin Sze
Kin Sze

Post Reply

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