Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
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:



enter



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

 Answers
1

Guessing you're loading a newer version of jQuery. It appears as though jQuery 1.9 and later does not have the jQuery.event.handle property.



To my knowledge, this was never a supported property.



http://jsfiddle.net/xPJN4/


[#79588] Wednesday, March 13, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hallie

Total Points: 503
Total Questions: 114
Total Answers: 103

Location: Iraq
Member since Fri, Jun 5, 2020
4 Years ago
;