javascript
js1:对象的学习,构造函数,继承构造函数【使用教材:JavaScript深度剖析第2版】...
原文發布時間為:2008-11-08 —— 來源于本人的百度文章 [由搬家工具導入]
<html>
<head>
<title>js</title>
<script language="JavaScript">
?? function Company(){
this.cname="aa";
this.products="bb";
}
function Sales(){
this.fromwhere="cc";
this.reps="50";
this.meth=disp;
}
Sales.prototype=new Company();
var t1="t1";
function disp(){
t2="t2";
var t3="t3";
document.write(this.reps+"<br>");
document.write(this.cname);
document.write(this.fromwhere);
document.write(this.products);
}
</script>
</head>
<body>
<script language="JavaScript">
var s1=new Sales();
s1.meth();
Sales.prototype.size="78";
document.write(t1);
document.write(t2);
document.write(t3);
</script>
</body>
</html>
<!--結果為
50
aaccbbt1t2
-->
轉載于:https://www.cnblogs.com/handboy/p/7148450.html
總結
以上是生活随笔為你收集整理的js1:对象的学习,构造函数,继承构造函数【使用教材:JavaScript深度剖析第2版】...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Pandas数据处理实战:福布斯全球上市
- 下一篇: Apache OFBIZ高速上手(二)-