jQuery not defined
-
If you use this plugin alongside a performance optimisation or caching plugin, and you have JavaScript concatenation enabled, you might run into a jQuery error. It would show up in the browser console on the front-end like this:
ReferenceError: jQuery is not defined
This might happen due to missing dependencies and can usually be fixed by changing this line:
wp_register_script( 'net-neutrality-js', plugins_url( 'net-neutrality.js', __FILE__ ), array(), '20140904' );
into this:
wp_register_script( 'net-neutrality-js', plugins_url( 'net-neutrality.js', __FILE__ ), array( 'jquery' ), '20140904' );
(Note the declared dependency:
array( 'jquery' )
)
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘jQuery not defined’ is closed to new replies.