zoukankan
html css js c++ java
prototype理解
<
script
>
function
aa()
{
this
.x
=
5
;
this
.y
=
6
;
//
内部定义的函数只有实例化后才可以使用
this
.test
=
function
(a)
{
alert(a
+
"
,
"
+
this
.x
+
"
,
"
+
this
.y);
}
}
//
prototype定义的函数未实例化就可以取得指针
aa.prototype.pany
=
function
(a)
{
alert(a
+
"
,
"
+
this
.x);
}
alert(aa.test);
alert(aa.prototype.test);
alert(aa.pany);
alert(aa.prototype.pany);
window[
"
Hello
"
]
=
aa;
aa.prototype[
"
MyAlert
"
]
=
aa.prototype.pany;
var
xx
=
new
Hello();
xx.MyAlert(
"
0
"
);
xx.pany(
"
1
"
);
//
xx.test(
"
2
"
);
</
script
>
查看全文
相关阅读:
img标签为什么可以设置宽高
高度和宽度的操作
自增自减运算符
读取标签内容:innerHTML和innerText的区别 text()和html()的区别
js中的常用方法
js中style,currentStyle和getComputedStyle的区别以及获取css操作方法(考虑兼容性和局限性)
IE盒模型与W3C盒模型区别
css四种定位方式及其区别
css隐藏元素的方法何区别
Hibernate之HQL
原文地址:https://www.cnblogs.com/panyee/p/386984.html
最新文章
eclipse 创建 user library 方法
hibernate_HelloWorld
hibernate 初印象
Struts2_总结
Struts2_使用token拦截器控制重复提交(很少用)
Strut2_声明式异常处理
Struts2_BBS2009小实战
Struts2_Struts标签
Struts2_Struts标签大致内容
Git使用教程
热门文章
iOS NSString类中获取子字符串
ios 获得版本号
iOS CABasicAnimation
ios view改变背景图
ios中点语法、property跟synthesize用法
js获取当前日期与星期
JavaScript事件
JavaScript
HTML
常见标签
Copyright © 2011-2022 走看看