CMS Development

MichaelWallis1
参加者 | Elite Partner
参加者 | Elite Partner

How to check user has included jQuery migrate

解決

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 いいね!
1件の承認済みベストアンサー
stefen
解決策
キーアドバイザー | Solutions Partner
キーアドバイザー | Solutions Partner

How to check user has included jQuery migrate

解決

@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

元の投稿で解決策を見る

2件の返信
stefen
解決策
キーアドバイザー | Solutions Partner
キーアドバイザー | Solutions Partner

How to check user has included jQuery migrate

解決

@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
参加者 | Elite Partner
参加者 | Elite Partner

How to check user has included jQuery migrate

解決

Perfect! Thanks.

0 いいね!