摘要: var string = 'javascript' !!~string.indexOf('java'); // true !!~string.indexOf('jsp'); // false var arr = [1,2,3,4,5]; !!~arr.indexOf(1); // true; !!~ 阅读全文
posted @ 2017-11-03 09:34 乾坤猪猪羊 阅读(212) 评论(0) 推荐(0) 编辑
摘要: CSS initial 关键字 实例 设置 <div> 元素内的文本颜色为红色,但是为 <h1> 元素保持最初的颜色: div {color: red; }h1 {color: initial; } 实例 设置 <div> 元素内的文本颜色为红色,但是为 <h1> 元素保持最初的颜色: div {c 阅读全文
posted @ 2017-01-04 09:48 乾坤猪猪羊 阅读(2738) 评论(0) 推荐(0) 编辑
摘要: r = arr.filter(function (element, index, self) { return self.indexOf(element) index;}); 阅读全文
posted @ 2016-12-29 15:18 乾坤猪猪羊 阅读(1187) 评论(0) 推荐(0) 编辑
摘要: var arr=[1,2,3,5,6]; arr.reduce(function(pre,cur,index,array){ return x=pre+cur },10) console.log(x) 注:reduce方法,要比 for循环和while 速度快。 控制台输出结果为:27 ,初始值 1 阅读全文
posted @ 2016-11-14 10:14 乾坤猪猪羊 阅读(1820) 评论(0) 推荐(0) 编辑
摘要: var arr = new Array(6) arr[0] = "a计划量余额"; arr[1] = "b计划发出"; arr[2] = "1计划量"; arr[3] = "强"; arr[4] = "采购倍数"; arr[5] = "计划收到"; arr[6] = "净需求"; arr[7] = 阅读全文
posted @ 2016-09-22 09:20 乾坤猪猪羊 阅读(2216) 评论(0) 推荐(0) 编辑
摘要: 做WebApp页面时,有时候,按钮可能会放到页面的最底下,这个时候可能会用到绝对定位(position: absolute),但是,当input 输入框被点击时,弹出的软键盘会顶起底部的按钮,就像这样: 这个时候,可以给 底下的 Button 或者包含这个Button的Div 添加一个CSS样式:z 阅读全文
posted @ 2016-09-12 11:22 乾坤猪猪羊 阅读(4900) 评论(1) 推荐(0) 编辑
摘要: var EventUtil = { getEvent: function(event){ return event ? event : window.event; }, getTarget: function(event){ return event.target || event.srcEleme 阅读全文
posted @ 2016-09-07 13:38 乾坤猪猪羊 阅读(597) 评论(0) 推荐(0) 编辑
摘要: 使用原型链实现继承,会有一个问题,多个实例共享一个属性。 为了解决这个问题,我们使用构造函数来实现继承。 function A(){ this.people=['name','age',"sex"]; } function B(){ A.call(this); } var x=new B(); x. 阅读全文
posted @ 2016-09-06 10:18 乾坤猪猪羊 阅读(435) 评论(0) 推荐(0) 编辑
摘要: function A(){ this.name="zhangsan"; } A.prototype.getName=function(){ return this.name; } function B(){ this.age=20; } B.prototype=new A(); //子类型有时候需要 阅读全文
posted @ 2016-09-06 10:00 乾坤猪猪羊 阅读(2318) 评论(0) 推荐(0) 编辑
摘要: XSS攻击:跨站脚本攻击(Cross Site Scripting),为不和层叠样式表(Cascading Style Sheets, CSS)的缩写混淆,故将跨站脚本攻击缩写为XSS。 XSS攻击分成两类: 一类是来自内部的攻击,主要指的是利用程序自身的漏洞,构造跨站语句,如:dvbbs的show 阅读全文
posted @ 2016-09-05 17:07 乾坤猪猪羊 阅读(325) 评论(0) 推荐(0) 编辑
欢迎光临乾坤猪猪羊博客园