Wordpress loads jQuery automatically. I want to use it, but I get:
jQuery is not defined
This is because various plugins mess with the ordering of scripts. So there's no guarantee that my script will load AFTER jQuery is loaded. So if it loads before, I get that error.
Can I wrap my script in something that waits for jQuery to load, and then executes my script?
Notes
- I don't want to manually load jQuery, because then I'll break various plugins... I must let Wordpress load it as usual
- I'm not a PHP person, so I don't want to hack the theme... I just want to wrap my script in a cross-browser "jquery waiting script"
defer
, which I cannot control as Wordpress controls jquery, and about document ready which is not relevant because jquery is not yet loaded. – lonix