So I've recently learned that putting your js at the bottom of the DOM is antiquated, and that I should be once again putting them in the <head> with the “async” and “defer” attributes.
Great. But I'm a bit confused as to which I should use, based on priority.
So I have:
- jquery
- jquery plugins that don't have immediate effects on the look of the page
- jquery plugins that do have immediate effects on the look of the page
- my own personal scripts, which have immediate effects on the look of the page, and is also reliant on jquery
Which should get async, and which should get defer?
If I understand all this correctly, the ones that don't have an immediate effect on the look of the site should get defer, while everything else gets async. Correct? Or am I getting these mixed up.