2

I'm having this strange problem when creating-deleting JavascriptMVC Observe. Every so often, an "Uncaught TypeError: Object # has no method 'apply'" pops up in this part of code.

$method = function( name ) {
            return function( eventType, handler ) {
                return $.fn[name].apply($([this]), arguments);

            }
        },
        bind = $method('bind'),
        unbind = $method('unbind');

To be more precise it is 'return $.fn[name].apply' line and problem is that when $method function is creating 'bind' or 'unbind' function $.fn.bind or $.fn.unbind don't exist.

What makes it even more strange is when i run in debug mode and i check for this expression everything run just fine.

typeof($.fn[name]) != "function"
Bizniztime
  • 1,016
  • 10
  • 22

0 Answers0