摘要: 第一章认识JavaScriptJavaScript特性: 1.面向对象编程的语言.function Person(name,age){ this.name = name; this.age = age;}Person.prototype.getName = function(){ return this.name;};Person.prototype.getAge = function(){ return this.age;};var p1 = new Person('John',30);var p2 = new Person('Bob',40);console 阅读全文
posted @ 2014-01-18 17:21 _彭建 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 变量变量是存储数据的容器变量的定义与赋值JavaScript变量名区分大小写var name; //只声明var age = 20; //声明并赋值var dog = 10; // dog 和 Dog 和 DOG 不相等单var声明模式var a,b='apple',c =10; //单var关键字,多变量var age = 28, name = 'Bob', fly = true;变量的类型var undef = undefined; // undefined类型var num = 10; // number 类型var str = 'tree' 阅读全文
posted @ 2014-01-18 11:57 _彭建 阅读(186) 评论(0) 推荐(0) 编辑