上一页 1 ··· 5 6 7 8 9 10 下一页
摘要: { // 长轮询 let ajax=function* (){ yield new Promise(function(resolve,reject){ setTimeout(function () { resolve({code:0}) }, 200); }) } let pull=function(){ le... 阅读全文
posted @ 2017-10-31 21:05 abcByme 阅读(309) 评论(0) 推荐(0) 编辑
摘要: function getExplorer() { var explorer = window.navigator.userAgent; //ie if (explorer.indexOf("MSIE") >= 0) { return 'ie'; } ... 阅读全文
posted @ 2017-10-30 15:40 abcByme 阅读(1113) 评论(0) 推荐(0) 编辑
摘要: 转自:CTOLib , www.ctolib.com/topics-107352.html ggraph - 图形可视化的凌乱数据 转自:CTOLib , www.ctolib.com/topics-107352.html ggraph - 图形可视化的凌乱数据 转自:CTOLib , www.ct 阅读全文
posted @ 2017-10-27 17:41 abcByme 阅读(4689) 评论(0) 推荐(1) 编辑
摘要: /* 获取当前环境: 系统环境: iOS Android PC 浏览器环境 微信内置浏览器、QQ内置浏览器、正常浏览器 是否app内打开 */ var ua = navigator.userAgent.toLowerCase(); //获取浏览器标识并转换为小写 var curConfig = { isiOS: !!navigator.userAgent.... 阅读全文
posted @ 2017-10-26 13:49 abcByme 阅读(4818) 评论(0) 推荐(3) 编辑
摘要: Iterator遍历器 遍历器(Iterator)就是这样一种机制。它是一种接口,为各种不同的数据结构提供统一的访问机制。任何数据结构只要部署Iterator接口,就可以完成遍历操作(即依次处理该数据结构的所有成员)。 作用: 为各种数据结构,提供一个统一的、简便的访问接口 使得数据结构的成员能够按 阅读全文
posted @ 2017-10-24 19:55 abcByme 阅读(537) 评论(0) 推荐(0) 编辑
摘要: { // 基本定义 let ajax = function(callback) { console.log('执行'); //先输出 1 执行 setTimeout(function() { callback && callback.call() }, 1000); }; ajax(funct... 阅读全文
posted @ 2017-10-23 20:48 abcByme 阅读(435) 评论(0) 推荐(0) 编辑
摘要: { // 基本定义和生成实例 class Parent{ constructor(name='mukewang'){ this.name=name; } } let v_parent1=new Parent(); let v_parent2=new Parent('v'); console.log('构造函数和实例',v_parent1,v_p... 阅读全文
posted @ 2017-10-23 19:52 abcByme 阅读(508) 评论(0) 推荐(0) 编辑
摘要: { //原始对象 let obj={ time:'2017-03-11', name:'net', _r:123 }; //(代理商)第一个参数代理对象,第二个参数真正代理的东西 let monitor=new Proxy(obj,{ // 拦截对象属性的读取 get(target,key){ return target... 阅读全文
posted @ 2017-10-23 19:27 abcByme 阅读(667) 评论(1) 推荐(0) 编辑
摘要: 1 用户名正则 //用户名正则,4到16位(字母,数字,下划线,减号) var uPattern = /^[a-zA-Z0-9_-]{4,16}$/; //输出 true console.log(uPattern.test("iFat3")); 2 密码强度正则 //密码强度正则,最少6位,包括至少1个大写字母,1个小写字母,1个数字,1个特殊字符 var pPattern = /^.*(?=... 阅读全文
posted @ 2017-10-23 18:10 abcByme 阅读(7545) 评论(2) 推荐(0) 编辑
摘要: function testNumber(){ var yourinputValue=$("#yourinputId").val(); var reg = /^[1-9]\d*$/; alert(reg.test(yourinputValue)) } 阅读全文
posted @ 2017-10-23 17:56 abcByme 阅读(22539) 评论(0) 推荐(0) 编辑
摘要: //数据结构对比 增查改删 { //map、set和Object let item = {t:1}; let map = new Map(); let set = new Set(); let obj = {}; //增 map.set('t',1); set.add(item); obj['t'] = 1; co... 阅读全文
posted @ 2017-10-21 23:18 abcByme 阅读(990) 评论(0) 推荐(0) 编辑
摘要: //数据结构对比 增查改删 { //map和array对比 let map = new Map(); let array = []; //增 map.set('t',1); array.push({t:1}); console.info('map-array',map,array) //{"t"=>1};-[0:{t:1}] ... 阅读全文
posted @ 2017-10-21 22:56 abcByme 阅读(1440) 评论(0) 推荐(0) 编辑
摘要: { let list = new Set(); list.add(5); list.add(7); console.log('size', list, list.size); //{5, 7} 2 } { let arr = [1, 2, 3, 4, 5]; let list = new Set(arr); console.log('... 阅读全文
posted @ 2017-10-20 19:30 abcByme 阅读(570) 评论(0) 推荐(0) 编辑
摘要: function hrefObj() { var localhref = window.location.href; var localarr = localhref.split('?')[1].split('&'); console.log(localarr) var tempObj = {}; 阅读全文
posted @ 2017-10-19 19:05 abcByme 阅读(6770) 评论(2) 推荐(0) 编辑
摘要: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.or 阅读全文
posted @ 2017-10-18 17:25 abcByme 阅读(679) 评论(0) 推荐(0) 编辑
摘要: var day1 = new Date("2017-9-17"); var day2 = new Date("2017-10-18"); console.log((day2 - day1) / (1000 * 60 * 60 * 24)); 阅读全文
posted @ 2017-10-18 17:04 abcByme 阅读(1224) 评论(0) 推荐(1) 编辑
摘要: function tab(date1,date2){ var oDate1 = new Date(date1); var oDate2 = new Date(date2); if(oDate1.getTime() > oDate2.getTime()){ console.log('第一个大'); } else { console.l... 阅读全文
posted @ 2017-10-18 16:20 abcByme 阅读(90274) 评论(2) 推荐(2) 编辑
摘要: { // 声明 let a1 = Symbol(); let a2 = Symbol(); console.log(a1 === a2); //false let a3 = Symbol.for('a3'); let a4 = Symbol.for('a3'); console.log(a3 === a4); //true } { ... 阅读全文
posted @ 2017-10-17 23:19 abcByme 阅读(640) 评论(0) 推荐(0) 编辑
摘要: getBeforeDate: function(day, str) { var now = new Date().getTime(); //获取毫秒数 var before = new Date(now - ((day > 0 && day ? day : 0) * 86400 * 1000)); var year = before.getFullYear(); var month = befo... 阅读全文
posted @ 2017-10-16 17:57 abcByme 阅读(844) 评论(0) 推荐(1) 编辑
摘要: { //简洁表示法 let o = 1; let k = 2; let es5 = { o:o, k:k }; let es6 = { o,k }; console.log(es5,es6); //1,2;1,2 let es5_method = { hell... 阅读全文
posted @ 2017-10-10 22:36 abcByme 阅读(888) 评论(0) 推荐(0) 编辑
摘要: //函数参数默认值(more值后不能有参数) { function test(x,y = 'world'){ console.log('默认值',x,y); } test('hello');// hello world test('hello','kill'); //hello kill } //作用域概念 { let x = 'te... 阅读全文
posted @ 2017-10-10 20:47 abcByme 阅读(407) 评论(0) 推荐(0) 编辑
摘要: Document t1 点击获取ip click me 阅读全文
posted @ 2017-10-10 16:39 abcByme 阅读(3760) 评论(0) 推荐(0) 编辑
摘要: Document 获取验证码 阅读全文
posted @ 2017-10-09 09:47 abcByme 阅读(871) 评论(0) 推荐(1) 编辑
摘要: 倒计时 还剩 阅读全文
posted @ 2017-09-30 18:02 abcByme 阅读(860) 评论(0) 推荐(0) 编辑
摘要: { let arr = Array.of(3, 4, 7, 9, 11); console.log('arr', arr); //[3,4,7,9,11] let empty = Array.of(); console.log(empty); //[] } //ES6为Array增加了from函数用来将其他对象转换成数组。 //当然,其他对象也是有要求,也不是所... 阅读全文
posted @ 2017-09-30 17:04 abcByme 阅读(791) 评论(0) 推荐(0) 编辑
摘要: { //二进制数值都是0b开头,八进制0o console.log(0b111110111) //503 console.log(0o767); //503 } { console.log('15',Number.isFinite(15)); //true console.log('NaN',Number.isFinite(NaN)); //false N... 阅读全文
posted @ 2017-09-30 15:22 abcByme 阅读(300) 评论(0) 推荐(0) 编辑
摘要: { console.log('a',`\u0061`); //a,a console.log('s',`\u20BB7`); //s ₻7 console.log('s',`\u{20BB7}`) //s 𠮷 }//charCodeAt 和 codePointAt{ let s = 'a'; le 阅读全文
posted @ 2017-09-29 17:38 abcByme 阅读(316) 评论(0) 推荐(0) 编辑
摘要: https://www.mobiscroll.com/ https://github.com/xfhxbb/LCalendar 温馨提示:强烈建议使用:https://github.com/zhoushengmufc/iosselect 不建议使用 demo下载链接:http://download. 阅读全文
posted @ 2017-09-29 16:00 abcByme 阅读(943) 评论(0) 推荐(0) 编辑
摘要: 仿微信抢红包 javascript实现仿微信抢红包 红包个数:个 总&ensp;金&ensp;额:元 发红包 参考《微信红包的架构设计简介》文章 ... 阅读全文
posted @ 2017-09-29 14:18 abcByme 阅读(2257) 评论(0) 推荐(1) 编辑
摘要: //默认登记时间为今天 var date = new Date; var year = date.getFullYear(); var month = date.getMonth() + 1; month = month < 10 ? "0" + month : month; var day = d 阅读全文
posted @ 2017-09-28 19:18 abcByme 阅读(367) 评论(0) 推荐(0) 编辑
摘要: { //es5中 let regex = new RegExp('xyz', 'i'); let regex2 = new RegExp(/xyz/i); console.log(regex.test('xyz123'), regex2.test('xyz123')); // true,true / 阅读全文
posted @ 2017-09-28 19:03 abcByme 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 1.结构赋值 { let a,b,c; [a,b] = [1,2]; console.log(a,b); //1,2} { let a,b,rest; [a,b,...rest] = [1,2,3,4,5,6]; console.log(a,b,rest); //3,[4,5,6]} 2.对象结构赋 阅读全文
posted @ 2017-09-28 17:41 abcByme 阅读(645) 评论(0) 推荐(0) 编辑
摘要: 一、let 和const 1.let 只在自己声明的块作用域中有效; function test(){ let a = 'a'; var b = 'b'; for(let i =1;i<3;i++){ console.log(i); //正常 1.2 } console.log(a,b); //正常 阅读全文
posted @ 2017-09-28 16:33 abcByme 阅读(414) 评论(0) 推荐(0) 编辑
摘要: 转自 http://blog.csdn.net/qq_29676303/article/details/76098196注意 事项 1.es6下创建三个目录 app server tasks 2.在 app下 创建 css js views 3.进入app/js目录 创建index.js(js入口文 阅读全文
posted @ 2017-09-28 14:44 abcByme 阅读(717) 评论(0) 推荐(0) 编辑
摘要: 1.npm install -g express-generator 2.进入服务目录(自己定义的文件夹,或者express Myapp && cd Myapp 新建Myapp文件夹并进入) 3.npm install 4.express -e 5.Y 继续 6.npm install instal 阅读全文
posted @ 2017-09-27 14:52 abcByme 阅读(1765) 评论(0) 推荐(0) 编辑
摘要: 注: origin为远程仓库名称 master为远程分支名称 //第一次提交所有代码 1.git clone 项目url 2.复制.git 和文件到根目录 3.git add . 4.git commit -m "XXXX(提交说明)" 5.git push -u origin master:xxx 阅读全文
posted @ 2017-09-27 14:47 abcByme 阅读(2073) 评论(3) 推荐(0) 编辑
摘要: (function() { 'use strict' angular.module('myApp') .controller('catesDetailCtr', ['$scope', '$state', '$rootScope', 'MyServer', 'ipCookie', function($ 阅读全文
posted @ 2017-09-25 09:46 abcByme 阅读(249) 评论(0) 推荐(0) 编辑
摘要: // 对象转数组并倒序 // function objToArray(array) { // var arr = []; // for (var a in array) { // var item = { // key: a, // value: array[a] // } // arr.push( 阅读全文
posted @ 2017-09-22 18:43 abcByme 阅读(1226) 评论(1) 推荐(0) 编辑
摘要: {{(value.time+'000' | date:'yyyy-MM-dd HH:mm:ss') : '/'}} .filter('getWeek', function() { return function(input) { var date = new Date(input * 1000); var week = date.getDay(); switch (week) { case 0... 阅读全文
posted @ 2017-09-19 20:54 abcByme 阅读(695) 评论(0) 推荐(0) 编辑
摘要: 测试副本 aId cId developer ... 阅读全文
posted @ 2017-09-19 20:51 abcByme 阅读(423) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 下一页