按栏目快速找到需要的在线工具。
JSON 解析、格式化、压缩、对比与实体生成。
Base64、URL、进制、哈希与 AES 加密工具。
DNS、SEO、HTTP、robots 与站点检查。
日期、计算器、健康与便民工具。
前端、编程、数据库与服务器教程。
11 个工具栏目,按使用场景分类。
日期:2014-05-16 浏览次数:20744 次
在阅读精通JavaScript(图灵计算机科学丛书)里面有讲解javascript继承的一些东东。
其一是讲解DouglasCrockford的js
代码如下:
第二个工具函数是base库
代码:
/* Base.js, version 1.1a Copyright 2006-2010, Dean Edwards License: http://www.opensource.org/licenses/mit-license.php */ var Base = function() { // dummy }; Base.extend = function(_instance, _static) { // subclass var extend = Base.prototype.extend; // build the prototype Base._prototyping = true; var proto = new this; extend.call(proto, _instance); proto.base = function() { // call this method from any other method to invoke that method's ancestor }; delete Base._prototyping; // create the wrapper for the constructor function //var constructor = proto.constructor.valueOf(); //-de