How to check user has included jQuery migrate

SOLVE
Highlighted
Occasional Contributor

Hi everyone

 

I am developing a theme to comply with the Hubspot theme requirements and one of those is to check if the user has included jQuery. If they have not and your site requires jQuery to run, you need to run it yourself.

 

My site additionally requires the jQuery migration script which can be toggled by the user in the same way.

 

How can I check for the migrate setting the way I do with '

{% if not site_settings.include_jquery %}' ?
Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
Solution
Regular Advisor | Partner

@MichaelWallis1 I would try this:

{% if standard_header_includes is string_containing "jquery-migrate" %}
  i am a hubspot site that uses jquery migrate!
{% endif %}
Stefen Phelps, Community Champion, Kelp Web Developer

View solution in original post

2 Replies 2
Highlighted
Solution
Regular Advisor | Partner

@MichaelWallis1 I would try this:

{% if standard_header_includes is string_containing "jquery-migrate" %}
  i am a hubspot site that uses jquery migrate!
{% endif %}
Stefen Phelps, Community Champion, Kelp Web Developer

View solution in original post

Highlighted
Occasional Contributor

Perfect! Thanks.

Reply
0 Upvotes