Aleš Sýkora wrote

Best practise for jQuery in Toolset

3. 7. 2019 in

Let me explain best practices for using jQuery inside a View, Form or Content Template’s JS panel.

  1. Always wrap your jQuery code in a document ready handler,
  2. Always use “jQuery” instead of “$” unless you know what you’re doing.

Example:

jQuery(document).ready(function(){
  // add your code here using "jQuery" instead of "$"
});

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

More from category
Aleš Sýkora wrote
ACF Repeater Post Object in oxygen code block
2. 10. 2020 in ,
You are using gutenberg and ACF and toolset and need to add related posts in slider, which you choose at the post you are editing? Also you need to put them in the content, exactly where you want? Create ACF repeater with Post Object field inside Create Oxygen Block for Gutenberg Add code block and […]
Read More
Aleš Sýkora wrote
Get WordPress title for page, post, category, archive in Oxygen
26. 1. 2021 in ,
Want to create only one template for Header and Footer – the main template – in Oxygen sometimes? So You need to display the title of current page, post, archive, category in one place. It cannot be done with Oxygen conditionals :(. So you have to make it done with code block and custom PHP. […]
Read More
Aleš Sýkora wrote
Fix WooCommerce coupon input in Oxygen
9. 4. 2021 in ,
The field for adding coupons in WooCommerce cart is horrible in Oxygen. If you want to fix it from: Before: After: Then feel free to use and edit my CSS:
Read More
magnifiercross linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram