zoukankan
html css js c++ java
js 命名空间
yui的命名空间和继承机制
var
YAHOO
=
window.YAHOO
||
{}
;
YAHOO.namespace
=
function
(ns)
{
if
(
!
ns
||
!
ns.length)
{
return
null
;
}
var
levels
=
ns.split(
"
.
"
);
var
nsobj
=
YAHOO;
//
YAHOO is implied, so it is ignored if it is included
for
(
var
i
=
(levels[
0
]
==
"
YAHOO
"
)
?
1
:
0
; i
<
levels.length;
++
i)
{
nsobj[levels[i]]
=
nsobj[levels[i]]
||
{}
;
nsobj
=
nsobj[levels[i]];
}
return
nsobj;
}
;
YAHOO.extend
=
function
(subclass, superclass)
{
var
f
=
function
()
{}
;
f.prototype
=
superclass.prototype;
subclass.prototype
=
new
f();
subclass.prototype.constructor
=
subclass;
subclass.superclass
=
superclass.prototype;
if
(superclass.prototype.constructor
==
Object.prototype.constructor)
{
superclass.prototype.constructor
=
superclass;
}
}
;
YAHOO.namespace(
"
util
"
);
YAHOO.namespace(
"
widget
"
);
YAHOO.namespace(
"
example
"
);
查看全文
相关阅读:
Introduces the basic structure of Android ActivityManagerService
创业的本质是资源整合
android系统的经典文章
GUI软件框架--窗口服务器
学习法则:只接收能够体系化的知识
编程思想:以什么样的方式来建模、分析、思考、解决问题
怎么从本质上理解面向对象的编程思想?
视图的对象化描述
DOM= Document Object Model,文档对象模型---以对象管理组织(OMG)的规约为基础的
GUI(UI编程)语言与面向对象、dsl
原文地址:https://www.cnblogs.com/rongfengliang/p/3599453.html
最新文章
2017OKR年终回顾与2018OKR初步规划
《T-SQL查询》读书笔记Part 3.索引的基本知识
《T-SQL查询》读书笔记Part 2.执行计划
也看《猎场》:几经秋冬,青春不在,一切皆贾,蓦然回首,伊人如故
《T-SQL查询》读书笔记Part 1.逻辑查询处理知多少
《你是在做牛做马还是在做主管》- 读书笔记
设计模式的征途(C#实现)—文章目录索引
设计模式的征途—23.解释器(Interpreter)模式
设计模式的征途—22.中介者(Mediator)模式
设计模式的征途—21.迭代器(Iterator)模式
热门文章
设计模式的征途—20.备忘录(Memento)模式
Binder 通信示例图
干货 | 彻底理解ANDROID BINDER通信架构(上)
Binder 原理整理
Android Binder机制---Linux上一切皆文件
第 1 章 Linux驱动开发概述
软件开发中的"上下文"的个人理解
上下文是系统中局部相对于整体的存在联系的描述x
上下文是系统中局部相对于整体的存在联系的描述
架构的主要工作之一是管理全局上下文
Copyright © 2011-2022 走看看