一、基本的类的使用
方法一:
function sth(a) // 构造函数
{
this.a = a;
this.fun = output; // 成员函数
}
function output(a, b, c)
{
document.write(this.a);
}
//调用
var s = new sth(250);
s.fun(1, 2, 3);
ouput(1, 2, 3); //如果output在sth之前就是错的
本文地址:https://www.stayed.cn/item/18702
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我