Problem:
I have had my custom JS code working for years, and now it seems to be not working anymore5 all of a sudden.
I see the error Uncaught TypeError: $ is not a function in the console.
Solution:
JS needs a namespace like jQuery when used in WordPress.
a $ will conflict with an increasing amount of scripts if used on WordPress
Relevant Documentation:
https://toolset.com/documentation/user-guides/views/adding-custom-javascript-views/#achieving-great-results-with-little-coding-by-using-jquery
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | - | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 |
- | - | - | - | - | - | - |
Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)
This topic contains 2 replies, has 2 voices.
Last updated by 4 years, 10 months ago.
Assisted by: Beda.