随笔分类 -  JavaScript Js用法

摘要:indexOf(): http://www.w3school.com.cn/jsref/jsref_indexOf.asp splice(): http://www.w3school.com.cn/jsref/jsref_splice.asp 阅读全文
posted @ 2017-12-28 11:50 芒果加冰 阅读(374) 评论(0) 推荐(0)
摘要:new Date()获取系统当前时间: var currentTime= new Date().getYear();//获取当前年份(2位) var currentTime= new Date().getFullYear();//获取当前完整年分(4位) var currentTime= new Date().getMonth();//获取当前月份(0~11,0代表1月) var current... 阅读全文
posted @ 2017-12-11 11:06 芒果加冰 阅读(9752) 评论(0) 推荐(0)
摘要:window.localStorage.getItem('键'); //getItem获取浏览器localStorage保存的键的值; window.localStorage.setItem('键','值'); //setItem保存键的值到浏览器的localStorage; 阅读全文
posted @ 2017-11-04 10:23 芒果加冰 阅读(825) 评论(0) 推荐(0)
摘要:三目运算符在HTML里面的运用 (a //当a<b条件成立时,也就是a<b为true时显示a的值, //当a<b条件不成立时,也就是a<b为false时显示b的值。 相当于if..else..语句;if条件为true时结果为a,为false为b。 阅读全文
posted @ 2017-10-28 09:41 芒果加冰 阅读(316) 评论(0) 推荐(0)
摘要:数组.forEach(function(item,index){ }) //forEach循环数组,item为循环数组中的每个对象,index为循环每个对象的位置。 阅读全文
posted @ 2017-10-26 11:39 芒果加冰 阅读(129) 评论(0) 推荐(0)
摘要:angular.copy()可以复制一个对象或数组. 使用方法: 阅读全文
posted @ 2017-09-19 19:28 芒果加冰 阅读(808) 评论(0) 推荐(0)
摘要:上传Excel文件代码demo: 下载上传js文件:bower install ng-file-uploa;引入js文件; 阅读全文
posted @ 2017-09-14 11:33 芒果加冰 阅读(587) 评论(0) 推荐(0)
摘要:字符串转数组:getShowColumnId = $filter('split')(getShowColumnId, ',');数组转字符串:getShowColumnId = $filter('join')(getShowColumnId, ',');字符串转换数字:var currentVide 阅读全文
posted @ 2017-06-22 21:17 芒果加冰
摘要:var columnId = self.currentTable.ListColumn.filter(function (item, index) { return index < 8}).map(function (column) { return column.Id}); window.loca 阅读全文
posted @ 2017-06-22 17:58 芒果加冰