172
rated 0 times
[
176]
[
4]
/ answers: 1 / hits: 17824
/ 11 Years ago, thu, march 14, 2013, 12:00:00
My chances are slim with this but I've tried a couple of solutions via Google but nothing seems to fix the 'Uncaught TypeError: Cannot call method 'apply' of undefined ', anonymous function:
It works if on its own with no other JS but when combined on the same page as other scripts I get the error.
The lines of code it refers to are the following with line 32 being the culprit. Line 32 is this line - if ( resizeTimeout ) { clearTimeout( resizeTimeout ); }
:
var $event = $.event, resizeTimeout;
$event.special.smartresize = {
setup: function() {
$(this).bind( resize, $event.special.smartresize.handler );
},
teardown: function() {
$(this).unbind( resize, $event.special.smartresize.handler );
},
handler: function( event, execAsap ) {
// Save the context
var context = this,
args = arguments;
// set correct event type
event.type = smartresize;
if ( resizeTimeout ) { clearTimeout( resizeTimeout ); }
resizeTimeout = setTimeout(function() {
jQuery.event.handle.apply( context, args );
}, execAsap === execAsap? 0 : 100 );
}
};
More From » debugging