I get this message:
"Object [object Object] has no method 'on' "
to the code:
$(window).on('resize', function () {
self.setDimensions();
});
what can I do? I already have jQuery 1.9...
I get this message:
"Object [object Object] has no method 'on' "
to the code:
$(window).on('resize', function () {
self.setDimensions();
});
what can I do? I already have jQuery 1.9...
Make sure you use at least jQuery version 1.7
Prior to 1.7, you can replace .on()
with .bind()
(if you're not using event delegation).
The best would probably be for you to upgrade to the lastest jQuery version - 1.9 ATM.
If you have included the latest version of jQuery, and it still says there is no on
, then that means some other library is overwriting $
. To solve this issue, try this:
$.noConflict();
jQuery(document).ready(function($) {
// Use $ here
var self = mysterious();
$(window).on("resize", function(){
self.setDimensions();
})
});