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
>
查看全文
相关阅读:
shell 之awk 关联数组高级应用
Just do it!!!
windows 环境下搭建django 错误分析总结
webpy 开发环境搭建问题之Mysql-python安装
Python 文本处理的应用
利用python httplib模块 发送Post请求测试web服务是否正常起来!
Ncurses
Ncurses-窗口
使用 curses 函数库管理基于文本的屏幕
vector的 []
原文地址:https://www.cnblogs.com/panyee/p/386984.html
最新文章
WinForm 小练习 计算器(已简化)
一个ADO的综合小练习
数据模型和数据访问类以及属性扩展和泛型集合
一个ADO的小练习
完整修改和删除以及防字符串注入攻击
前端面试汇集
微信小程序之公共函数引入
微信小程序之上传下载交互api
正则表达式常用原则
检测屏幕横屏状态
热门文章
meta的各种参数
关于ios手机游览器针对overflow:hidden设置无效的解决办法
让微信,qq,uc浏览器使用全屏模式,全屏模式里,浏览器是不会上下左右滑动出现背景的
关于json.parse和json.stringify的区别
更改后台传递前端图片的尺寸
关于vue如何解决数据渲染完成之前,dom树显示问题
python 之调用Linux shell命令及相关高级应用
替换字符串中的子串
urllib2 之info 学习
Python 之 geturl 学习
Copyright © 2011-2022 走看看