08 2016 档案

js继承
摘要:最基础的原型链 原型和实例的关系 a instanceof object a instanceof subType a instanceof superType//都是true 借用构造函数 在继承中,也有遗留的实例和原型函数中的引用问题 如果超类的原型函数中有引用,子类的修改将受到波及 我们现在可 阅读全文

posted @ 2016-08-15 14:11 Kooing 阅读(201) 评论(0) 推荐(0)

原型模式
摘要:这里的a,b实例的数据都是一样的 var a={};//不能用字面量方法定义 判断原型函数和实例是否匹配 console.log(People.prototype.isPrototypeOf(a),People.prototype.isPrototypeOf(b)); 实例返回对象原型 Object 阅读全文

posted @ 2016-08-15 01:19 Kooing 阅读(174) 评论(0) 推荐(0)

创建对象
摘要:1理解对象 1)创建对象 方法1 var person=new Object();person.name="fuck";person.age=16; 方法2 var person={name:"fuck",age:12} 工厂模式 构造函数模式 a instanceof Object;//true 阅读全文

posted @ 2016-08-14 02:03 Kooing 阅读(166) 评论(0) 推荐(0)

属性类型
摘要:2)属性类型 数据属性(重要的话,在本身是true,在方法中默认是false [[Configurable]] 能否删除从而重新定义,能否修改属性的特性,能否把属性改为访问器属性 [[Enumerable]]能否for-in [[writable]]能否写 [[Value]]读写 要修改属性的默认特 阅读全文

posted @ 2016-08-14 01:05 Kooing 阅读(375) 评论(0) 推荐(0)

Math方法
摘要:var values=[1,2,3,4,5,56]; var a=Math.max.apply(this,values); Math.ceil();//向上四舍五入 Math.floor();//向下四舍五入 Math.round();//正常四舍五入 Math.random();//0~1的一个小 阅读全文

posted @ 2016-08-13 11:07 Kooing 阅读(112) 评论(0) 推荐(0)

url编码方法(暂时知道是什么
摘要:var a="https://i.cnblogs.com/EditPosts.aspx?opt=1" encodeURI(a); encodeURIComponent(); decodeURI(a); decodeURIComponent(); 阅读全文

posted @ 2016-08-13 08:53 Kooing 阅读(183) 评论(0) 推荐(0)

string的一些操作,类似数组
摘要:1.串的切割 var a="hello world";//a.length=11 alert(a.slice(3)); alert(a.substring(3)); alert(a.substr(3));//三个都lo world alert(a.slice(3,7));//3到7 alert(a. 阅读全文

posted @ 2016-08-13 07:45 Kooing 阅读(458) 评论(0) 推荐(0)

RegExp
摘要:1 两种写法 var b=/[cb]at/; var b=new RegExp("[cb]at") 在字符串中专业要注意 2 1)exec表示捕获 var c="i want to fuck"; var b=/to/g; var d=b.exec(c);//d.index表示位置,d.input表示 阅读全文

posted @ 2016-08-09 11:53 Kooing 阅读(119) 评论(0) 推荐(0)

Date对象
摘要:var a=new Date();//新建一个时间对象 var b=new Date(Date.parse("2013/2/4"));//parse方法,设置过去的 var c=new Date(Date.UTC(2013,2,3,9,1,1));//utc方法,可以精确秒,小时要按照标准时区 va 阅读全文

posted @ 2016-08-09 10:59 Kooing 阅读(146) 评论(0) 推荐(0)

js引用类型姿势
摘要:栈 1)var a=new Array(),a.push(a,b,...),a.pop() queue 1)var a=new Array(), a.push(a,b,...),a.shift() a.unshift(a,b....),a.pop()反向队列 数组方法 1)由于按照string排序v 阅读全文

posted @ 2016-08-08 23:54 Kooing 阅读(156) 评论(0) 推荐(0)

js函数知识点
摘要:1.即使写成functon a()也是可以调用外面定义的变量的,写(a,b),我估计是为了降低耦合性 2.即使写成function a()也是可以用arguments[a]来默认写了(a,b) 3.在函数里面不定义就使用新变量,新变量变成全局变量 function add () { sum=argu 阅读全文

posted @ 2016-08-08 10:26 Kooing 阅读(173) 评论(0) 推荐(0)

js基本类型
摘要:1.undefined 1)var a;//没有赋值的时候就是undefined 2)undefined派生自null,alert(undefined==null)//true 虽然这上条语句是一样,但其他方面是几乎没有相关,我们不需要显式地写var a=undefined,但写var a=null 阅读全文

posted @ 2016-08-08 09:52 Kooing 阅读(271) 评论(0) 推荐(0)

defer和async
摘要:1.decument.wirte不能使用 2.<script src="text.js" type="text/javascript" defer="defer" charset="utf-8"></script> <script src="text2.js" type="text/javascri 阅读全文

posted @ 2016-08-08 08:24 Kooing 阅读(120) 评论(0) 推荐(0)

网页计算器
摘要:test click stop again 阅读全文

posted @ 2016-08-02 01:08 Kooing 阅读(146) 评论(0) 推荐(0)

导航