摘要: 1.var b = a.slice(beginIndex,endIndex);[].slice.call( [] )Array.prototype.slice.call([])will copy the arrayaintob. 阅读全文
posted @ 2014-01-22 15:56 NancyChan 阅读(243) 评论(0) 推荐(0) 编辑
摘要: typeof用以获取一个变量的类型,typeof一般只能返回如下几个结果:number,boolean,string,function,object,undefinedinstanceof用于判断一个变量是否某个对象的实例Use instanceof for custom types:1 var C... 阅读全文
posted @ 2014-01-22 15:52 NancyChan 阅读(226) 评论(0) 推荐(0) 编辑
摘要: attachEvent方法,为某一事件附加其它的处理事件。(不支持Mozilla系列)addEventListener方法 用于 Mozilla系列举例:document.getElementById("btn").onclick = method1;document.getElementById("btn").onclick = method2;document.getElementById("btn").onclick = method3;如果这样写,那么将会只有medhot3被执行写成这样:var btn1Obj = docum 阅读全文
posted @ 2014-01-22 15:34 NancyChan 阅读(205) 评论(0) 推荐(0) 编辑