水栽培植物要怎么做:请问在JAVASCRIPT里可以定义两个类吗?

来源:百度文库 编辑:神马品牌网 时间:2024/04/30 00:51:45
我在改别人的程序。原来的程序是好的,我只是在原来代码下面添加了一个类,及这个类的两个方法,运行的时候,错误是原来定义的那个类未定义。不知道为什么。
谢谢
function Cookie(document,name, hours, path, domain, secure)
{ // 保存Cookie
this.$document = document;
this.$name = name;
if(hours)
this.$expiration = new Date((new Date()).getTime() + hours * 3600000);
else this.$expiration = null;
if(path) this.$path = path;
else this.$path = null;
if(domain) this.$domain = domain;
else this.$domain = null;
if(secure) this.$secure = ture;
else this.$secure = false;

this.store = store;
this.getCookie = getCookie;

}//end funciton Cookie

贴出你加的代码来呀