摘要: javascript创建对象创建一个对象,然后给这个对象新建属性和方法。var box = new Object();//创建一个 Object 对象box.name = 'Lee';//创建一个 name 属性并赋值box.age = 100;//创建一个 age 属性并赋值box.run = function () {//创建一个 run()方法并返回值 return this.name + this.age + '运行中...';};alert(box.run());//输出属性和方法的值上面创建了一个对象,并且创建属性和方法,在 run()方法里的 th 阅读全文
posted @ 2013-02-01 01:44 lines 阅读(7776) 评论(0) 推荐(0) 编辑