上一页 1 ··· 94 95 96 97 98 99 100 101 102 ··· 167 下一页
摘要: //&&得到的结果不是布尔类型,如果前面都是 true就执行最后一个,并返回最后一个表达式的值,前面有一个为false,后面不执行,返回前面表达式的值 var a = 3; var b = a && (a = 4); console.log(b);//4 var b = a && (a ++); console.log(a);//5 console.log(b);//4 a && (a ++);... 阅读全文
posted @ 2017-05-13 14:16 无天666 阅读(1295) 评论(0) 推荐(0)
摘要: //this:this可以写在js全剧环境中(全局环境中this是window对象),this可以写在函数中,可以写在对象中, function f(){ this.name = "asdfas"; } var o ={ name :"cj", print:function(){ console.log(this.name); } }; o.p... 阅读全文
posted @ 2017-05-12 18:33 无天666 阅读(165) 评论(0) 推荐(0)
摘要: var o = {}; var o1 = new Object();//这2种方式创建对象是一样的,因为对象都有默认属性constructor构造器,函数也是对象,js一切都是对象,函数也有构造器函数也是对象,构造器是对象的。 o.constructor 的构造器为 function Object(); o1.constructor 的构造器为 function Object(); o.con... 阅读全文
posted @ 2017-05-12 12:40 无天666 阅读(234) 评论(0) 推荐(0)
摘要: Object for(sx in p){//遍历对象的所有属性 console(sx); console(p.sx); } console("name" in p);//name属性是否在p中,true console(p.hasOwnProperty("name"));//p是否有name属性 delete p.name;//删除p的na... 阅读全文
posted @ 2017-05-12 00:00 无天666 阅读(299) 评论(0) 推荐(0)
摘要: d.onclick函数每执行一次就会产生一个独立的闭包,互不影响,闭包类似于一个对象,互不影响。 阅读全文
posted @ 2017-05-11 19:19 无天666 阅读(211) 评论(0) 推荐(0)
摘要: scope basic 作用域链:函数自己的作用域(大括号范围)找不到就去父级(父函数)的作用域去找。 每个函数有2个属性,一个是谁创建了这个函数(函数定义写在哪里面谁就是创建他的那个谁),一个是函数的作用域(函数题的局部作用域中有哪些属性和函数)。 阅读全文
posted @ 2017-05-11 06:27 无天666 阅读(199) 评论(0) 推荐(0)
摘要: 无标题文档 无标题文档 //Number和parseInt可以处理小部分非数字,非数字太多就不行了。 无标题文档 无标题文档 无标题文档 无标题文档 阅读全文
posted @ 2017-05-10 19:43 无天666 阅读(1286) 评论(0) 推荐(0)
摘要: 无标题文档 无标题文档 无标题文档 阅读全文
posted @ 2017-05-10 17:18 无天666 阅读(277) 评论(0) 推荐(0)
摘要: 无标题文档 无标题文档 无标题文档 阅读全文
posted @ 2017-05-10 15:56 无天666 阅读(269) 评论(0) 推荐(0)
摘要: 无标题文档 无标题文档 无标题文档 无标题文档 图片抖动 图片抖动 function doMove ( obj, attr, dir, target, endF... 阅读全文
posted @ 2017-05-10 15:24 无天666 阅读(205) 评论(0) 推荐(0)
上一页 1 ··· 94 95 96 97 98 99 100 101 102 ··· 167 下一页