代码改变世界

随笔分类 -  Html5/Javascript

转:Javascript继承机制的设计思想

2011-07-13 15:36 by x_feng, 161 阅读, 收藏,
摘要: 作者写的非常好,让人醍醐灌顶!本文转自:http://www.ruanyifeng.com/blog/2011/06/designing_ideas_of_inheritance_mechanism_in_javascript.html作者: 阮一峰日期: 2011年6月 5日我一直很难理解Javascript语言的继承机制。它没有"子类"和"父类"的概念,也没有"类"(class)和"实例"(instance)的区分,全靠一种很奇特的"原型链"(prototype chain)模式,来实现继承 阅读全文

html5 <canvas> 学习4步曲

2011-07-13 11:24 by x_feng, 291 阅读, 收藏,
摘要: 1,Basic usage:https://developer.mozilla.org/cn/Canvas_tutorial%3aBasic_usage2,绘制图形 Drawing shapes: https://developer.mozilla.org/cn/Canvas_tutorial%3aDrawing_shapes3,应用图像 Using images:https://developer.mozilla.org/cn/Canvas_tutorial%3aUsing_images4,运用样式与颜色:https://developer.mozilla.org/cn/Canvas_tut 阅读全文