美文网首页
jquery 方法

jquery 方法

作者: 我的昵称好听吗 | 来源:发表于2018-10-28 23:19 被阅读0次

学习jquery源码

1.判断是否是函数

var isFunction = function isFunction( obj ) {

      // Support: Chrome <=57, Firefox <=52
      // In some browsers, typeof returns "function" for HTML <object> elements
      // (i.e., `typeof document.createElement( "object" ) === "function"`).
      // We don't want to classify *any* DOM node as a function.
      return typeof obj === "function" && typeof obj.nodeType !== "number";
  };

相关文章

网友评论

      本文标题:jquery 方法

      本文链接:https://www.haomeiwen.com/subject/wuhvtqtx.html