I am using a jQuery based WordPress Twitter widget and receive the error "ReferenceError: _ is not defined
".
Am not sure how to declare the variable "_".
Here is the widget:
I am using a jQuery based WordPress Twitter widget and receive the error "ReferenceError: _ is not defined
".
Am not sure how to declare the variable "_".
Here is the widget:
Firebug states that the line of code with the error is:
jQuery( _.template( template, { user: twitters[0].user } )).insertAfter('.bizsteam_twitter ul');
Any help would be greatly appreciated
Your widget has Underscore.js/LoDash.js as dependency.
You can get them here: underscore, lodash
Try prepending this to your code, so you can see if it works:
You can install it by bower:
Node.js npm install underscore Meteor.js meteor add underscore Require.js require(["underscore"], ... Bower bower install underscore Component component install jashkenas/underscore
Here's the link to the oficial page http://underscorejs.org/
i was facing the same problem in the wp-admin section of the site. I enqueued the underscore script cdn and it fixed the problem.
function kk_admin_scripts() { wp_enqueue_script('underscore', '//cdnjs.cloudflare.com/ajax/libs/lodash.js/0.10.0/lodash.min.js' ); } add_action( 'admin_enqueue_scripts', 'kk_admin_scripts' );