摘要: 什么是闭包(文献):函数对象通过作用域链相互关联,函数体变量可以保存在函数作用域内(保护函数内的局部变量,不受全局变量影响) 阅读全文
posted @ 2017-03-06 12:43 CodeProducter 阅读(103) 评论(0) 推荐(0) 编辑
摘要: jQuery.extend使用的几种方式 1.jQuery.extend(源对象) 1 jQuery源代码: 2 3 if(length == i){ 4 target = this; 5 --i; 6 } 7 8 示例1: 9 10 var person = { 11 sex : 'male', 阅读全文
posted @ 2017-02-28 19:21 CodeProducter 阅读(1492) 评论(0) 推荐(0) 编辑
摘要: 要搞清楚$('div','li') 和 $('div , li') 和 $('div li') 区别 $('div','li')是$(子,父),是从父节点里找子,而不是找li外面的div $('div , li')才是找所有的div和li,之间不存在父子关系 $('div li') 是找div里面所 阅读全文
posted @ 2017-02-15 12:28 CodeProducter 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 故在设置当前时间时候需要加上 date_default_timezone_set('prc'); 或者 在php.ini里面设置date.timezone=prc 阅读全文
posted @ 2016-12-28 11:34 CodeProducter 阅读(955) 评论(0) 推荐(0) 编辑
摘要: 处理方法: 阅读全文
posted @ 2016-11-14 16:16 CodeProducter 阅读(221) 评论(0) 推荐(0) 编辑
摘要: function fun(){ var wWidth = null, wHeight = null; if(window.innerHeight && window.innerWidth){ wHeight = window.innerHeight; wWidth = window.innerWid 阅读全文
posted @ 2016-11-04 18:18 CodeProducter 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 1 String a = "1,2,3,4"; 2 3 String[] arr = a.split(","); 4 5 取arr中所有字符在预定义字符中进行过滤 6 7 8 9 例如:在里面过滤字符串为"1"的数据 10 11 for(int k=0;k<arr.length;k++){ 12 13 if("1".equals(a... 阅读全文
posted @ 2016-10-31 14:57 CodeProducter 阅读(823) 评论(0) 推荐(0) 编辑
摘要: 该方法用于建立一个锚点,点击锚点,会跳到相应的内容,且该内容头部与浏览器头部平齐 实例: 阅读全文
posted @ 2016-10-12 19:45 CodeProducter 阅读(8507) 评论(0) 推荐(1) 编辑
摘要: 获取子代元素节点:children 获取所有子代元素节点数:**.childElementCount 或者 **.children.length 阅读全文
posted @ 2016-10-11 10:47 CodeProducter 阅读(723) 评论(0) 推荐(0) 编辑
摘要: 当在某个局域范围内要调用构造函数中或者其他局域范围内的方法 此时可以用到临时调用方法call与apply var a = {"0":"a","1":"b",length:2}; 1.利用字符串连接 var b = Array.prototype.join.call(a,"+"); //临时调用数组a 阅读全文
posted @ 2016-10-10 16:39 CodeProducter 阅读(187) 评论(0) 推荐(0) 编辑