色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

javascript面向?qū)ο缶幊?一) 實(shí)例代碼

復(fù)制代碼 代碼如下:
<script type="text/Javascript">
var test = {
numA: 10,
objB: {},
arrC: [],
init: function(){
alert(this.numA);
},
sayHi: function(name){
alert("hello " + name);
},
sayHelloWorld: function(){
this.sayHi("world");
},
get: function(){
var self = this;
this.objB.alertNumA = function(){
alert(self.numA);
}
}
};
var TestFunc = function(){
alert("i'm testFunc");
};
TestFunc.prototype = {
extFunc: function(){
alert("this extend function's numB is " + this.numB);
},
numB: 10
};
test.init();
test.sayHi("qingming");
test.sayHelloWorld();
test.get();
test.objB.alertNumA();
var testFunc = new TestFunc();
testFunc.extFunc();
</script>

JavaScript技術(shù)javascript面向?qū)ο缶幊?一) 實(shí)例代碼,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 四平市| 稷山县| 仲巴县| 谷城县| 华亭县| 寻乌县| 郎溪县| 丹东市| 古田县| 湘潭县| 密山市| 静安区| 通州市| 衡阳市| 沁水县| 甘南县| 栾城县| 普定县| 沂源县| 文山县| 连云港市| 泸州市| 黄山市| 浦北县| 区。| 女性| 和龙市| 文昌市| 都兰县| 砚山县| 茌平县| 鹿邑县| 新泰市| 浮山县| 庆安县| 长白| 九龙城区| 修水县| 灵山县| 海晏县| 新巴尔虎右旗|