Skip to content

Move registered jQuery to the document footer #66

@cjg89

Description

@cjg89

Description

See title. We currently register it in the document head, but since we've made updates to our plugins that register custom JS to load them late + in the footer, and now that Gravity Forms 2.5+ supports jQuery in the footer, we should no longer need to do this.

If we do experience breakage with plugin JS after moving jQuery down, we need to just update said plugin(s) to ensure they properly register jquery as a dependency when they're enqueued.

Why it's Important

jQuery is a big file; moving it to the footer is one less (significant) blocking request when loading frontend content.

Alternatives

n/a

Possible Implementation

Update false to true here, and update function comments:

wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js', null, null, false );

Additional context

n/a

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions