摘要:
一.定义全局变量命名空间 只创建一个全局变量,并定义该变量为当前应用容器,把其他全局变量追加在该命名空间下 二 . 利用匿名函数将脚本包裹起来 阅读全文
摘要:
location.pathname.slice(location.pathname.substr(1).indexOf('/')+1) 阅读全文
摘要:
String.prototype.place= function (val) { var rst = -1; for (var i = 0; i < this.length; i++) { if (val[0] == this[i]) { var temp = i; if (rst != -1) { 阅读全文
摘要:
计算属性:计算属性是基于它们的依赖进行缓存的,计算属性只有在它的相关依赖发生改变时才会重新求值。如果我们需要缓存,可用计算属性 阅读全文
摘要:
Promise Promise可以用来避免异步操作函数里的嵌套回调(callback hell)问题 阅读全文
摘要:
1.字符串转JSON 2.JSON转字符串 3.JSON增加元素 4.JSON删除元素 阅读全文
摘要:
第一种最常用的:for循环 for(j = 0; j < arr.length; j++) { } 优化版for循环 对于数组较大时,优化比较明显; 第二种:foreach array.forEach(function(currentValue, index, arr), thisValue) 第三 阅读全文
摘要:
charAt():返回指定索引位置的字符 charCodeAt():返回指定索引位置字符的 Unicode 值 fromCharCode():将 Unicode 转换为字符串 concat():连接两个或多个字符串,返回连接后的字符串 indexOf():返回字符串中检索指定字符第一次出现的位置 l 阅读全文
摘要:
document.body.scrollTop = document.documentElement.scrollTop = 0; 阅读全文
摘要:
在客户端命令行使用命令 svn cleanup D:/.......(被锁定的文件夹) 阅读全文