10 2015 档案

摘要:var style=window.getComputedStyle(element).property(属性);只读属性,不可修改(包括内联样式,以及以外的样式都可获取)IE9一下不支持获取对象的属性值。elm.currentStyle则支持所有的IE。兼容:functiongetConputedS... 阅读全文
posted @ 2015-10-28 19:34 /null 阅读(398) 评论(0) 推荐(0)
摘要:函数声明functionfoo(){}函数foo将会在整个程序执行前被hoist(提升),因此它在定义 foo 函数的整个scope(作用域)中都是可用的。即使在函数定义之前调用它也没问题。函数表达式如果没有函数名的话,一定就是函数表达式,但是对于有函数名的情况该如何判断呢?Javascript规定... 阅读全文
posted @ 2015-10-25 18:16 /null 阅读(381) 评论(0) 推荐(0)
摘要://1.使用typeof..//无需封装直接使用.//可以识别标志类型(null除外)//不可识别具体的对象类型typeof(1);//"number"typeof("");//"string"typeof([]);//"object"typeof({});//"object"typeof(null... 阅读全文
posted @ 2015-10-17 23:24 /null 阅读(524) 评论(0) 推荐(0)
摘要:functionrandom(){varnum=Math.floor(Math.random()*1000);returnnum;}varnumber=random();console.log(number);functionmultiply(){varnum=arguments[0];//应该是=... 阅读全文
posted @ 2015-10-14 19:34 /null 阅读(886) 评论(0) 推荐(0)