linux5620207 2016-07-07 06:38 采纳率: 5.3%
浏览 1005

javascript对象方法的原型是对象自己?

首先要说明这是完全可行的,因为jquery中就是这么做的

var jQuery = function(selector,context){
     return new jQuery.fn.init(selector,context,rootjQuery);
},
jQuery.fn = jQuery.prototype = {
     constructor : jQuery,
     init:function(selector,context,rootjQuery){...}
};
jQuery.fn.init.prototype = jQuery.fn;

但我总是理解不了。哪位大神能说一下自己的见解,也许某几句话就能让我醍醐灌顶,谢谢!

  • 写回答

1条回答 默认 最新

  • gamedev˚ 2016-07-07 10:32
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 CreateBitmapFromWicBitmap内存释放问题。
  • ¥30 win c++ socket
  • ¥15 CanMv K210开发板实现功能
  • ¥15 C# datagridview 栏位进度
  • ¥15 vue3页面el-table页面数据过多
  • ¥100 vue3中融入gRPC-web
  • ¥15 kali环境运行volatility分析android内存文件,缺profile
  • ¥15 写uniapp时遇到的问题
  • ¥15 vs 2008 安装遇到问题
  • ¥15 matlab有限元法求解梁带有若干弹簧质量系统的固有频率