CMS Development

MichaelWallis1
Participant | Elite Partner
Participant | Elite Partner

How to check user has included jQuery migrate

SOLVE

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 %}' ?
0 Upvotes
1 Accepted solution
stefen
Solution
Key Advisor | Partner
Key Advisor | Partner

How to check user has included jQuery migrate

SOLVE

@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
stefen
Solution
Key Advisor | Partner
Key Advisor | Partner

How to check user has included jQuery migrate

SOLVE

@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
MichaelWallis1
Participant | Elite Partner
Participant | Elite Partner

How to check user has included jQuery migrate

SOLVE

Perfect! Thanks.

0 Upvotes