<SCRIPT LANGUAGE="JavaScript">
<!--
function People(h){
//类里面的变量
this.height = h;
//对象里的函数
this.max =function(a,b){
var c = a>b?a:b;
return c;
}
this.say=function(){
alert("saying!");
}
this.max=function(a,b,c){
var m=this.max(a,b);
var n=this.max(m,c);
return n
}
}
var people = new People(200);
peopel...
不知道下面如何写了。。。
小弟是刚开始学(参加培训,一点基础都没有)
<!--
function People(h){
//类里面的变量
this.height = h;
//对象里的函数
this.max =function(a,b){
var c = a>b?a:b;
return c;
}
this.say=function(){
alert("saying!");
}
this.max=function(a,b,c){
var m=this.max(a,b);
var n=this.max(m,c);
return n
}
}
var people = new People(200);
peopel...
不知道下面如何写了。。。
小弟是刚开始学(参加培训,一点基础都没有)
本文介绍了一个自定义的JavaScript对象People,该对象包含了属性height及两个方法:max用于找出三个数中最大的一个,say则用于弹窗提示。文章适合初学者学习JavaScript的基础知识。

被折叠的 条评论
为什么被折叠?



