1 2 3 4 | function Point(x, y){ this.x = x; this.y = y; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 | function Point(x, y){ this.x = x; this.y = y; this.moveTo = function(x, y){ this.x = x; this.y = y; } } var p1 = new Point(0, 0); var p2 = {x: 0, y: 0}; p1.moveTo(1, 1); p1.moveTo.apply(p2, [10, 10]); |
1 | button.onclick = myObject.handler; |
1 | button.onclick = lang.hitch(myObject, myObject.handler); |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |