摘要: 一.prototype原型对象,需要注意的原则是: (1). 使用原型可以大量减少每个对象对内存的需求量,因为对象可以继承许多属性。 (2). 即使属性在对象被创建之后才被添加至原型中,对象也能够继承这些属性。示例代码:prototype调用 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><scripttype="text/javascript">functionprint(msg){document.wri 阅读全文
posted @ 2010-12-03 13:23 collum 阅读(248) 评论(0) 推荐(0) 编辑
摘要: javscript中定义和声明函数有三种方式:正常方法 构造函数 函数直接量。以下是各种方法的示例代码代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--<html><head></head><body>... 阅读全文
posted @ 2010-12-03 11:18 collum 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 在javascript函数体内,标识符arguments代表函数的实际参数,引用Arguments对象。1.arguments的属性length: 参数列表的实际长度2.arguments的属性callee:当前正在执行的函数例子代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHig... 阅读全文
posted @ 2010-12-03 10:08 collum 阅读(374) 评论(0) 推荐(0) 编辑