Using WordPress plugins
- Go to your WordPress Dashboard.
- On the left sidebar, navigate to Speed Booster.
- Click the Advanced tab, and activate Defer parsing of JS files.
- Once done, tap Save Changes.
- Using the async or defer attributes. …
- Log in to your site’s and install Headers and Footers plugin.
- Once it has installed, click on Activate.
- Upload it into your site to the following folder: wp-content/themes/<theme-you-are-using>/js/
To delay a function call, use setTimeout() function. functionname − The function name for the function to be executed. milliseconds − The number of milliseconds. arg1, arg2, arg3 − These are the arguments passed to the function.
What do you mean by defer?
Verb (1) defer, postpone, suspend, stay mean to delay an action or proceeding. defer implies a deliberate putting off to a later time. deferred buying a car until spring postpone implies an intentional deferring usually to a definite time.