摘要: 1 <html> 2 <head> 3 <script type="text/javascript" src="/jquery/jquery.js"></script> 4 <script type="text/javascript"> 5 $(document).ready(function(){ 阅读全文
posted @ 2015-12-09 16:05 /null 阅读(1311) 评论(0) 推荐(0)
摘要: 任何元素,除非你确定它是现存的,以后也会存在的,否则不要用从DOM搜索出来的东西做全局变量 阅读全文
posted @ 2015-12-06 01:40 /null 阅读(101) 评论(0) 推荐(0)
摘要: var obj = function(){}定义个叫obj的函数;(function a (){ return xx})();定义了一叫a方法,返回xx; 立即执行.var a = (function(){ var a = 'a'; var b = { xx : function(){}... 阅读全文
posted @ 2015-12-06 00:46 /null 阅读(131) 评论(0) 推荐(0)
摘要: http://www.adobe.com/cn/devnet/dreamweaver/articles/using-modernizr.html 介绍 阅读全文
posted @ 2015-12-05 23:33 /null 阅读(150) 评论(0) 推荐(0)
摘要: var a = (function () { return { }})()vara=function(){varb=function(){}}这样你在A外面就访问不了B我喜欢这样做的原因就是这样就确保了我的代码内部不会被外部访问 阅读全文
posted @ 2015-11-27 17:58 /null 阅读(163) 评论(0) 推荐(0)
摘要: var style=window.getComputedStyle(element).property(属性);只读属性,不可修改(包括内联样式,以及以外的样式都可获取)IE9一下不支持获取对象的属性值。elm.currentStyle则支持所有的IE。兼容:functiongetConputedS... 阅读全文
posted @ 2015-10-28 19:34 /null 阅读(392) 评论(0) 推荐(0)
摘要: 函数声明functionfoo(){}函数foo将会在整个程序执行前被hoist(提升),因此它在定义 foo 函数的整个scope(作用域)中都是可用的。即使在函数定义之前调用它也没问题。函数表达式如果没有函数名的话,一定就是函数表达式,但是对于有函数名的情况该如何判断呢?Javascript规定... 阅读全文
posted @ 2015-10-25 18:16 /null 阅读(380) 评论(0) 推荐(0)
摘要: //1.使用typeof..//无需封装直接使用.//可以识别标志类型(null除外)//不可识别具体的对象类型typeof(1);//"number"typeof("");//"string"typeof([]);//"object"typeof({});//"object"typeof(null... 阅读全文
posted @ 2015-10-17 23:24 /null 阅读(521) 评论(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 阅读(881) 评论(0) 推荐(0)
摘要: 姓名性别暂住地 张山男浙江宁波 李四女浙江杭州 王五男湖南长沙 找六男浙江温州 Rain男浙江杭州 MAXMAN女浙江杭州 阅读全文
posted @ 2015-09-17 19:08 /null 阅读(257) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示