JavaScript实现继承---extend函数
来源:互联网 发布:怎样投诉淘宝网 编辑:程序博客网 时间:2024/06/06 01:24
JavaScript实现继承---extend函数
- 博客分类:
- JavaScript练习
JavaScriptprototype
- /* Extend Function */
- function extend(subClass,superClass){
- var Func = function(){} ;
- Func.prototype = superClass.prototype ;
- subClass.prototype = new Func() ;
- subClass.prototype.constructor = subClass ;
- } ;
- /*-----Example-----*/
- /* Class Person */
- function Person(name){
- this.name = name ;
- } ;
- Person.prototype.getName = function(){
- return this.name ;
- } ;
- /* Class Author */
- function Author(name,books){
- Person.call(this,name) ;
- this.books = books ;
- } ;
- extend(Author,Person) ;
- Author.prototype.getBooks = function(){
- return this.books ;
- } ;
- JavaScript实现继承---extend函数
- javascript 继承(extend)
- javascript 原型继承 extend
- JavaScript将继承部分封装成函数extend
- JavaScript的extend函数
- ExtJS学习------Ext.define的继承extend,用javascript实现类似Ext的继承
- js继承的实现 extend
- 实现 extend 函数
- Jquery实现$.fn.extend和$.extend函数
- Javascript的继承和Ext的Extend
- javascript的函数调用继承实现
- javascript call() apply() 函数 实现继承
- JavaScript继承实现(一)构造函数的继承
- [ JavaScript ] JavaScript 实现继承.
- Javascript中extend方法的实现
- JavaScript和ExtJS的继承 Ext.extend Ext.applyIf
- JavaScript函数继承
- javaScript构造函数继承
- hdu2955 Robberies
- 《数据通信与网络》笔记--QoS
- 自旋锁与同步对象的区别
- LeetCode-Anagrams
- windows下svn+apache搭建svn服务器
- JavaScript实现继承---extend函数
- imageview的简单使用和bitmap的使用
- 突发奇想
- JavaScript继承详解(五)
- hdu1839之二分+邻接表+Dijkstra+队列优化
- Android项目为一个apk设置多个ICON图标和执行入口
- Windows下搭建PHP开发环境
- JS 实现地区,省份,城市,县区4级联动
- HDU 4677 Query on Graph