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
"
);
查看全文
相关阅读:
SpringFlex框架搭建
SqlDataReader的用法 转自https://www.cnblogs.com/sunxi/p/3924954.html
C#学习笔记:ListBox控件的用法
C#栈Stack的使用
C# 队列Queue
xshell传送文件
Java基础中字符串与字符的注意点!
大数据的基础学习:
Python的空行
Python基本语法
原文地址:https://www.cnblogs.com/rongfengliang/p/3599453.html
最新文章
[优文翻译]002.陪伴我作为程序员的9句名言(9 Quotes that stayed with me as a developer)
C++程序设计1(侯捷video 1-6)(Inline、访问级别、const、引用传递返回、友元、操作符重载)
tensorflow学习笔记-bili莫烦
scikit-learn杂记
scikit-learn学习笔记-bili莫烦
机器学习 学习资料
机器学习-4 神经网络
机器学习-2 决策树
机器学习-1 基本概念
[Python自学] day-15 (CSS、JS、DOM)
热门文章
[Python自学] day-14 (HTML5、CSS)
Spring MVC 3.2 技术预览(三):动手写一个异步Controller方法
Spring MVC 3.2 技术预览(二):实时更新技术
Spring MVC 3.2 技术预览(一):Servlet 3介绍,异步支持
mvn eclipse:eclipse -Dwtpversion=2.0 -DdownloadSources=true -DdownloadJavadocs=true -DjdkLevel=1.6
SpringMVC-Mybatis-Maven项目整合
利用Stripes实现Java Web开发
mybatis实战教程(mybatis in action),mybatis入门到精通
MyBatis入门示例——MyBatis学习笔记之一
MongoDB学习笔记之 第1章 MongoDB的安装
Copyright © 2011-2022 走看看