日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

js1:对象的学习,构造函数,继承构造函数【使用教材:JavaScript深度剖析第2版】...

發布時間:2025/7/14 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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版】...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。