目前在百度上搜索了好多关于对象深拷贝的问题。 发现有的说 1, Objec.assign() 2, Array.slice(0) 3, [].concat(data) 发现都没有达到深层拷贝的目的, 但有一种方法可以实现深层拷贝 NewData = JSON.parse(JSON.stringify ...
分类:
编程语言 时间:
2016-11-11 23:48:41
阅读次数:
368
如下:获取abcd.txt文件的后缀名。 function getSuffix(file){ return file.slice(file.lastIndexOf(".") + 1,file.length); } ...
分类:
其他好文 时间:
2016-11-11 09:51:05
阅读次数:
145
获取第一个ul中的第一个li标签的方法: 选中如下代码中的各个ul中的第一个li标签 共有四种方案: 方案一: 方案二: 方案三: 方案四: 效果如下代码: ...
分类:
其他好文 时间:
2016-11-11 01:01:22
阅读次数:
534
1 (function () { 2 $.fn.moreImg = function () { 3 var allpar = Array.prototype.slice.call(arguments); 4 var elem = allpar[0]; 5 var allImg = allpar[1] ...
分类:
其他好文 时间:
2016-11-10 19:49:30
阅读次数:
132
找到bootstrap-datetimepicker.js, 把里面的this.defaultTimeZone=(new Date).toString().split("(")[1].slice(0,-1); 改为this.defaultTimeZone='GMT '+(new Date()).ge ...
分类:
其他好文 时间:
2016-11-10 19:35:15
阅读次数:
118
这小节我们将要介绍如何定义变量、常量、Go内置类型以及Go程序设计中的一些技巧。 定义变量 Go语言里面定义变量有多种方式。 使用var关键字是Go最基本的定义变量方式,与C语言不同的是Go把变量类型放在变量名后面: // 定义一个名称为“variableName”,类型为"type"的变量 var ...
分类:
其他好文 时间:
2016-11-09 11:21:17
阅读次数:
381
$('a[href*="#"],area[href*="#"]').click(function() { console.log(1); if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && l ...
分类:
其他好文 时间:
2016-11-08 16:42:38
阅读次数:
375
通过ntp服务实现时间同步。 1:首先搭建本地yum源见网址(http://www.cnblogs.com/zxbdbk/p/6020679.html) 2:先安装ntp服务 3:修改ntp的配置文件 # For more information about this file, see the m ...
分类:
系统相关 时间:
2016-11-07 19:38:20
阅读次数:
259
//法一 function parseNum(num){ var list = new String(num).split('').reverse(); for(var i = 0; i < list.length; i++){ if(i % 4 == 3){ list.splice(i, 0, ' ...
分类:
Web程序 时间:
2016-11-06 11:18:08
阅读次数:
316
一、词法结构 1、区分大小写 2、注意 // 单行 /* 多行注释 */ 3、字面量(直接量 literal) 12 //数字 5.8 // 小数 "hello" 'hello' true /js/gi //正则 null //空 {x:1,y:2} [1,2,3,4] 4、标示符(变量)和保留字 ...
分类:
其他好文 时间:
2016-11-05 09:22:55
阅读次数:
228