jQuery的$ .fn显示myFunction在我执行时被列为函数
console.log($.fn)
然而,当我这样做时:
console.log($.fn.myFunction)
它返回undefined
我有以下代码用于调试目的:
console.log($.fn);
//returns a list of functions with myFunction correctly listed as one
console.log($.fn.myFunction);
//returns undefined
console.log($.fn.contextmenu);
//correctly returns the function (I believe this is a generic jQuery function)
console.log($.fn.myFunction);
//returns undefined
console.log($.isFunction($.fn.myFunction));
//returns false
console.log($.isFunction($.myFunction));
//returns false