摘要: 在javascript中我们通过prototype属性可以来为一个已存在的类创建新方法。 如Number类是javascript提供的一个原始类,我们现在给它添加一个toHexString方法,这个方法用来返回整数的16进制结果 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHig... 阅读全文
posted @ 2008-06-26 14:54 Jumper 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 在javascript中有多种方法可以定义一个类 1.工厂方法 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->function createDuck() { var temp = new Object; temp.addre... 阅读全文
posted @ 2008-06-26 14:32 Jumper 阅读(624) 评论(0) 推荐(0) 编辑