Fork me on GitHub
摘要: 最近用js的类写东西,发现一个无比蛋疼的事,那就是封装的类方法中的this指针经常会改变指向,失去上下文,导致程序错误或崩溃。比如:function Obj(){ this.type = "obj";}Obj.prototype = { show : function (){ etTi... 阅读全文
posted @ 2015-07-30 18:25 donglegend 阅读(192) 评论(0) 推荐(0) 编辑