Guys I have this function from a wordpress plugin:
jQuery( '#widget-twitter-__i__-username' ).on( 'change', function() {
jQuery('#widget-twitter-__i__-list' ).val(0);
});
jQuery( '#widget-twitter-__i__-list' ).on( 'change', function() {
jQuery('#widget-twitter-__i__-username' ).val(0);
});
The error I am getting is:
TypeError: jQuery(...).on is not a function
When I click that error on the error console, I get to the above code.
And I was wondering what would be the way to address this issue.
Guys I have this function from a wordpress plugin:
jQuery( '#widget-twitter-__i__-username' ).on( 'change', function() {
jQuery('#widget-twitter-__i__-list' ).val(0);
});
jQuery( '#widget-twitter-__i__-list' ).on( 'change', function() {
jQuery('#widget-twitter-__i__-username' ).val(0);
});
The error I am getting is:
TypeError: jQuery(...).on is not a function
When I click that error on the error console, I get to the above code.
And I was wondering what would be the way to address this issue.
Share Improve this question edited Apr 16, 2016 at 11:56 fredmaggiowski 2,2483 gold badges28 silver badges44 bronze badges asked Sep 23, 2013 at 12:03 JeremyJeremy 9734 gold badges15 silver badges26 bronze badges 3- 7 jquery version used? – Arun P Johny Commented Sep 23, 2013 at 12:04
- 3 this method is not available in jQuery < 1.7 – Arun P Johny Commented Sep 23, 2013 at 12:04
-
1
@A.Wolff since it is saying
jQuery(...).on
I think jQuery is loaded, but a old version else it has to sayjQuery
is undefied – Arun P Johny Commented Sep 23, 2013 at 12:06
1 Answer
Reset to default 12If your jQuery version is under 1.7 i'd suggest using .delegate()
or .live()
or update your jQuery to the latest version
jQuery( '#widget-twitter-__i__-list' ).delegate(
or
jQuery( '#widget-twitter-__i__-list' ).live(